diff options
author | Eric Wong <e@80x24.org> | 2016-07-19 22:09:23 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-19 22:09:23 +0000 |
commit | 98beb40e1fe27160ee1b3ac2c87ef3020426fd43 (patch) | |
tree | 5c4aab00c40256f53378b0e928bb6293c864aacd /lib | |
parent | 7a211796fd643abf14692cab0b76e97d850219a4 (diff) | |
download | yahns-98beb40e1fe27160ee1b3ac2c87ef3020426fd43.tar.gz |
StringIO can never be truncated outside our control, so it is a bug if we see EOF on trysendio, here.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/wbuf_lite.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/yahns/wbuf_lite.rb b/lib/yahns/wbuf_lite.rb index 8a93ad1..577b4dc 100644 --- a/lib/yahns/wbuf_lite.rb +++ b/lib/yahns/wbuf_lite.rb @@ -68,16 +68,9 @@ class Yahns::WbufLite # :nodoc: @sf_offset += rv # keep going otherwise when :wait_writable, :wait_readable return rv - when nil - # response got truncated, drop the connection - # this may happens when using Rack::File or similar, we can't - # keep the connection alive because we already sent our Content-Length - # header the client would be confused. - @wbuf_persist = false - return wbuf_close(client) else - raise "BUG: rv=#{rv.inspect} " \ - "on tmpio=#{@tmpio.inspect} " \ + raise "BUG: #{rv.nil? ? 'EOF' : rv.inspect} on " + "tmpio.size=#{@tmpio.size} " \ "sf_offset=#@sf_offset sf_count=#@sf_count" end while @sf_count > 0 wbuf_close(client) |