rage-iodine 6.3.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bf4dfb83b39ffd7e2c88b535342d69b9ba6492dd80381e747c7f8909025b5c1
4
- data.tar.gz: 7d2e6bdafc532d94b296fb0743cfe832942421ecfa8ddab78a21f7f3e5c50f1e
3
+ metadata.gz: f31a1e1293d46f952128c7ece15210e0aa556f0cea777d495a7004b1149dc4a3
4
+ data.tar.gz: 92e1058f7c51fd433b63af3ea63615ce9b2db5f6a0d1589575fb3fd4b26379bf
5
5
  SHA512:
6
- metadata.gz: 9989075b63db053de7dd6678cb317aef338c9150acfb88da70a8cf0d77f13acd1b6c5aff12cadf212a85534f84832fb9b2af71580f88eb5fcc1de065f2d3b015
7
- data.tar.gz: bd74de0e0b28d2b035cc3df029ea7930ef57221ab4a443d88df873421ce4634567cb7e2fb06cfaec9a3e878feacb0d70541c6710191855c73b6d55c6173daf10
6
+ metadata.gz: 2b8c75f89c3ccb98bced51aa34ac85a1f821c6e7efb99862fddd93e1cb3f99fb860b930552e38c592c1d35d5e8825872a9bc188c45f69a3cf3908fb3d1ad5da1
7
+ data.tar.gz: 10322bd9b0295cebc6d2a84b62eeeebfd17691240d02ba97b71230939c2567b81e0d4a48796639540157b100f730bc2dbf5fdb2fb99541f8966988f49d28e878
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ Please notice that this change log contains changes for upcoming releases as wel
6
6
 
7
7
  ## Changes:
8
8
 
9
+ #### Change log v.6.4.0 (2026-10-29)
10
+
11
+ **Update**: Avoid disk writes for small chunked request bodies.
12
+
9
13
  #### Change log v.6.3.0 (2026-10-23)
10
14
 
11
15
  **Fix**: Fix `rack.input` buffer coderange
data/ext/iodine/http1.c CHANGED
@@ -656,15 +656,27 @@ static int http1_on_body_chunk(http1_parser_s *parser, char *data,
656
656
  http_send_error(&http1_pr2handle(parser2http(parser)), 413);
657
657
  return -1; /* test every time, in case of chunked data */
658
658
  }
659
+ FIOBJ *body = &http1_pr2handle(parser2http(parser)).body;
659
660
  if (!parser->state.read) {
660
- if (parser->state.content_length > 0 &&
661
- parser->state.content_length <= HTTP_MAX_HEADER_LENGTH) {
662
- http1_pr2handle(parser2http(parser)).body = fiobj_data_newstr();
663
- } else {
664
- http1_pr2handle(parser2http(parser)).body = fiobj_data_newtmpfile();
661
+ *body = fiobj_data_newstr();
662
+ }
663
+ /* Switch to a tmpfile once the body outgrows the threshold */
664
+ intptr_t len = fiobj_data_len(*body);
665
+ if (len <= HTTP_MAX_HEADER_LENGTH &&
666
+ len + (intptr_t)data_len > HTTP_MAX_HEADER_LENGTH) {
667
+ FIOBJ file = fiobj_data_newtmpfile();
668
+ if (!file) {
669
+ http_send_error(&http1_pr2handle(parser2http(parser)), 500);
670
+ return -1;
671
+ }
672
+ if (len) {
673
+ fio_str_info_s mem = fiobj_obj2cstr(*body);
674
+ fiobj_data_write(file, mem.data, mem.len);
665
675
  }
676
+ fiobj_free(*body);
677
+ *body = file;
666
678
  }
667
- fiobj_data_write(http1_pr2handle(parser2http(parser)).body, data, data_len);
679
+ fiobj_data_write(*body, data, data_len);
668
680
  return 0;
669
681
  }
670
682
 
@@ -26,7 +26,8 @@ Fiber Scheduler API
26
26
  ***************************************************************************** */
27
27
 
28
28
  static void noop(intptr_t uuid, fio_protocol_s *protocol) {
29
- (void)uuid;
29
+ /* Scheduler watches are one-shot, including unwanted read events. */
30
+ fio_suspend(uuid);
30
31
  (void)protocol;
31
32
  }
32
33
 
@@ -53,6 +54,9 @@ static void iodine_scheduler_task_close(intptr_t uuid, fio_protocol_s *fio_proto
53
54
  static void iodine_scheduler_task_perform(intptr_t uuid, fio_protocol_s *fio_protocol) {
54
55
  scheduler_protocol_s *protocol = (scheduler_protocol_s *)fio_protocol;
55
56
 
57
+ /* Suspend before resuming Ruby: it may immediately attach the next wait. */
58
+ fio_suspend(uuid);
59
+
56
60
  if (!protocol->fulfilled) {
57
61
  IodineCaller.call(protocol->block, call_id);
58
62
  protocol->fulfilled = 1;
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '6.3.0'.freeze
2
+ VERSION = '6.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rage-iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev