summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-05-13 19:33:40 +0800
committerZhidao HONG <z.hong@f5.com>2022-05-13 19:33:40 +0800
commit5883a2670fbeb1610014ec122a5fd20312399a90 (patch)
treebbb39c6b26dbf5d39abdd0565520aefe15193873
parent1fe389c2e216f21ba12ac7e373bcc26e43bde710 (diff)
downloadunit-5883a2670fbeb1610014ec122a5fd20312399a90.tar.gz
unit-5883a2670fbeb1610014ec122a5fd20312399a90.tar.bz2
Ruby: added stream IO "close" required by Rack specification.
This closes #654 issue on Github.
-rw-r--r--docs/changes.xml6
-rw-r--r--src/ruby/nxt_ruby_stream_io.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/changes.xml b/docs/changes.xml
index ba7e41a3..af963bbb 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -51,6 +51,12 @@ compatibility with GCC 12.
<change type="bugfix">
<para>
+Ruby Sinatra applications don't work without custom logging.
+</para>
+</change>
+
+<change type="bugfix">
+<para>
the controller process could crash when a chain with more than 4
certificates was uploaded.
</para>
diff --git a/src/ruby/nxt_ruby_stream_io.c b/src/ruby/nxt_ruby_stream_io.c
index 82ad3908..4ef69cee 100644
--- a/src/ruby/nxt_ruby_stream_io.c
+++ b/src/ruby/nxt_ruby_stream_io.c
@@ -18,6 +18,7 @@ static VALUE nxt_ruby_stream_io_puts(VALUE obj, VALUE args);
static VALUE nxt_ruby_stream_io_write(VALUE obj, VALUE args);
nxt_inline long nxt_ruby_stream_io_s_write(nxt_ruby_ctx_t *rctx, VALUE val);
static VALUE nxt_ruby_stream_io_flush(VALUE obj);
+static VALUE nxt_ruby_stream_io_close(VALUE obj);
VALUE
@@ -38,6 +39,7 @@ nxt_ruby_stream_io_input_init(void)
rb_define_method(stream_io, "each", nxt_ruby_stream_io_each, 0);
rb_define_method(stream_io, "read", nxt_ruby_stream_io_read, -2);
rb_define_method(stream_io, "rewind", nxt_ruby_stream_io_rewind, 0);
+ rb_define_method(stream_io, "close", nxt_ruby_stream_io_close, 0);
return stream_io;
}
@@ -60,6 +62,7 @@ nxt_ruby_stream_io_error_init(void)
rb_define_method(stream_io, "puts", nxt_ruby_stream_io_puts, -2);
rb_define_method(stream_io, "write", nxt_ruby_stream_io_write, -2);
rb_define_method(stream_io, "flush", nxt_ruby_stream_io_flush, 0);
+ rb_define_method(stream_io, "close", nxt_ruby_stream_io_close, 0);
return stream_io;
}
@@ -257,3 +260,10 @@ nxt_ruby_stream_io_flush(VALUE obj)
{
return Qnil;
}
+
+
+static VALUE
+nxt_ruby_stream_io_close(VALUE obj)
+{
+ return Qnil;
+}