rage-iodine 6.2.0 → 6.4.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: 67d84c1a37795b81e5bfcdd207e94124b35015905a22908ff4ce99c4e5474ecd
4
- data.tar.gz: cc5007e6625fdc36c1c39286e724bfc6cbb9f3711f8b6b3f7e39a84994ddfd63
3
+ metadata.gz: 209fcf94b4cec12ccef647a0463a2256919859ab012e724f89ef6bbb60aea7e7
4
+ data.tar.gz: c8ff6f19d0228ac11f485cc8b6c1edd85a132ae7a3ab94a8e7da8909ee103440
5
5
  SHA512:
6
- metadata.gz: 5b3af183fcc0234eb71ae9df561f01ded132b2d2b216cee114309b15f09b9b9814879c92c7c016bbe412cf4587d0cbda449303b9db390d7ed65ce851f64c18cd
7
- data.tar.gz: b9341b9d06ce950d505d4bd1c7ecfe9671e93e08cc2d45062c1fdaeca6cbdcd25dfe328d6abe21421bf38548137708b4bb243a91936ce2d735a8f1974376e021
6
+ metadata.gz: 02e9552071a7f52674c564595ce4e315ab41dc40b4b0a858d6a092e11ec69a4ed5a370e0ffda2028b2fdaa99217966da276425b8b9965faec58f12e75453a5a0
7
+ data.tar.gz: 1978be98f2912cde1b2c6a97483caee8118f795fcb3a22180b8a57c87e3138a31ed085dcd19d4589bb171f7bfd23d8fe649e1b3fc01f6f7907b00e86c7fe13db
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ 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
+
13
+ #### Change log v.6.3.0 (2026-10-23)
14
+
15
+ **Fix**: Fix `rack.input` buffer coderange
16
+
9
17
  #### Change log v.5.9.0/v.6.2.0 (2026-10-15)
10
18
 
11
19
  **Fix**: Prevent process hang on exit caused by a use-after-free in pub/sub teardown (`fio_cluster_at_exit` read a channel freed by `fio_unsubscribe` of its last subscription; it now performs a bounded best-effort cleanup instead). See #21.
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
 
@@ -146,6 +146,7 @@ static VALUE rio_read(int argc, VALUE *argv, VALUE self) {
146
146
  } else {
147
147
  // make sure the buffer is binary encoded.
148
148
  rb_enc_associate(buffer, IodineBinaryEncoding);
149
+ rb_str_modify(buffer);
149
150
  if (rb_str_capacity(buffer) < (size_t)buf.len)
150
151
  rb_str_resize(buffer, buf.len);
151
152
  memcpy(RSTRING_PTR(buffer), buf.data, buf.len);
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '6.2.0'.freeze
2
+ VERSION = '6.4.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.2.0
4
+ version: 6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev