diff options
author | Eric Wong <e@80x24.org> | 2016-06-05 22:48:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-05 22:48:44 +0000 |
commit | 5e211ea003d20708a221d124e139f72ded4e18b0 (patch) | |
tree | 392185e2eb42888853fc016711a19d452542e46f /lib/yahns/http_response.rb | |
parent | dcdeb4071ded73bcf4fd696b268bce7ee2021f5d (diff) | |
download | yahns-5e211ea003d20708a221d124e139f72ded4e18b0.tar.gz |
@busy will be reset on wbuf_write anyways, since there is no initial data and we will always attempt to write to the socket aggressively.
Diffstat (limited to 'lib/yahns/http_response.rb')
-rw-r--r-- | lib/yahns/http_response.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb index 4b36db2..531194f 100644 --- a/lib/yahns/http_response.rb +++ b/lib/yahns/http_response.rb @@ -57,12 +57,12 @@ module Yahns::HttpResponse # :nodoc: "#{response_start}#{code} #{Rack::Utils::HTTP_STATUS_CODES[code]}\r\n\r\n" end - def response_header_blocked(ret, header, body, alive, offset, count) + def response_header_blocked(header, body, alive, offset, count) if body.respond_to?(:to_path) alive = Yahns::StreamFile.new(body, alive, offset, count) body = nil end - wbuf = Yahns::Wbuf.new(body, alive, self.class.output_buffer_tmpdir, ret) + wbuf = Yahns::Wbuf.new(body, alive, self.class.output_buffer_tmpdir) rv = wbuf.wbuf_write(self, header) if body && ! alive.respond_to?(:call) # skip body.each if hijacked body.each { |chunk| rv = wbuf.wbuf_write(self, chunk) } @@ -171,7 +171,7 @@ module Yahns::HttpResponse # :nodoc: when :wait_writable, :wait_readable # unlikely if k.output_buffering alive = hijack ? hijack : alive - rv = response_header_blocked(rv, buf, body, alive, offset, count) + rv = response_header_blocked(buf, body, alive, offset, count) body = nil # ensure we do not close body in ensure return rv else @@ -199,7 +199,7 @@ module Yahns::HttpResponse # :nodoc: chunk = rv # hope the skb grows when we loop into the trywrite when :wait_writable, :wait_readable if k.output_buffering - wbuf = Yahns::Wbuf.new(body, alive, k.output_buffer_tmpdir, rv) + wbuf = Yahns::Wbuf.new(body, alive, k.output_buffer_tmpdir) rv = wbuf.wbuf_write(self, chunk) break else |