rhebok 0.8.3 → 0.8.5
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 +4 -4
- data/Changes +4 -0
- data/ext/rhebok/rhebok.c +10 -4
- data/lib/rack/handler/rhebok.rb +2 -2
- data/lib/rhebok/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63c847aca36084736ee20d2439a2a868f9cfdf09
|
4
|
+
data.tar.gz: 8a24d9b12665ace439784f2fe5d727da562a17b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77d3d23898445c851b65b945306c6fe19bdbe6af7332afa8578deca059e11d6204cb33aed2984492d9d05de2d0d682b89e4847bd831d2f958e0800b7bc8c942
|
7
|
+
data.tar.gz: 430031512ebf4a7a2054dabb651266738eef9ac6051a63b646f87a5b075d63a21ccfb263d2c67786091cf6d97cb9149f0f63b191f6062a0302f55571a5dd7f54
|
data/Changes
CHANGED
data/ext/rhebok/rhebok.c
CHANGED
@@ -708,7 +708,7 @@ VALUE rhe_close(VALUE self, VALUE fileno) {
|
|
708
708
|
}
|
709
709
|
|
710
710
|
static
|
711
|
-
VALUE rhe_write_response(VALUE self, VALUE filenov, VALUE timeoutv, VALUE status_codev, VALUE headers, VALUE body, VALUE use_chunkedv) {
|
711
|
+
VALUE rhe_write_response(VALUE self, VALUE filenov, VALUE timeoutv, VALUE status_codev, VALUE headers, VALUE body, VALUE use_chunkedv, VALUE header_onlyv) {
|
712
712
|
ssize_t hlen = 0;
|
713
713
|
ssize_t blen = 0;
|
714
714
|
|
@@ -739,7 +739,13 @@ VALUE rhe_write_response(VALUE self, VALUE filenov, VALUE timeoutv, VALUE status
|
|
739
739
|
double timeout = NUM2DBL(timeoutv);
|
740
740
|
int status_code = NUM2INT(status_codev);
|
741
741
|
int use_chunked = NUM2INT(use_chunkedv);
|
742
|
-
|
742
|
+
int header_only = NUM2INT(header_onlyv);
|
743
|
+
|
744
|
+
/* status_with_no_entity_body */
|
745
|
+
if ( status_code < 200 || status_code == 204 || status_code == 304 ) {
|
746
|
+
use_chunked = 0;
|
747
|
+
}
|
748
|
+
|
743
749
|
harr = rb_ary_new();
|
744
750
|
RB_GC_GUARD(harr);
|
745
751
|
rb_hash_foreach(headers, header_to_array, harr);
|
@@ -870,7 +876,7 @@ VALUE rhe_write_response(VALUE self, VALUE filenov, VALUE timeoutv, VALUE status
|
|
870
876
|
iovcnt++;
|
871
877
|
}
|
872
878
|
}
|
873
|
-
if ( use_chunked ) {
|
879
|
+
if ( use_chunked && header_only == 0 ) {
|
874
880
|
v[iovcnt].iov_base = "0\r\n\r\n";
|
875
881
|
v[iovcnt].iov_len = sizeof("0\r\n\r\n") - 1;
|
876
882
|
iovcnt++;
|
@@ -958,5 +964,5 @@ void Init_rhebok()
|
|
958
964
|
rb_define_module_function(cRhebok, "write_timeout", rhe_write_timeout, 5);
|
959
965
|
rb_define_module_function(cRhebok, "write_all", rhe_write_all, 4);
|
960
966
|
rb_define_module_function(cRhebok, "close_rack", rhe_close, 1);
|
961
|
-
rb_define_module_function(cRhebok, "write_response", rhe_write_response,
|
967
|
+
rb_define_module_function(cRhebok, "write_response", rhe_write_response, 7);
|
962
968
|
}
|
data/lib/rack/handler/rhebok.rb
CHANGED
@@ -301,9 +301,9 @@ module Rack
|
|
301
301
|
headers.key?("Content-Length") ? 0 : 1
|
302
302
|
|
303
303
|
if body.instance_of?(Array)
|
304
|
-
::Rhebok.write_response(connection, @options[:Timeout], status_code.to_i, headers, body, use_chunked)
|
304
|
+
::Rhebok.write_response(connection, @options[:Timeout], status_code.to_i, headers, body, use_chunked, 0)
|
305
305
|
else
|
306
|
-
::Rhebok.write_response(connection, @options[:Timeout], status_code.to_i, headers, [], use_chunked)
|
306
|
+
::Rhebok.write_response(connection, @options[:Timeout], status_code.to_i, headers, [], use_chunked, 1)
|
307
307
|
body.each do |part|
|
308
308
|
ret = nil
|
309
309
|
if use_chunked == 1
|
data/lib/rhebok/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhebok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nagano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|