StringIO can never be truncated outside our control, so it is
a bug if we see EOF on trysendio, here.
---
 lib/yahns/wbuf_lite.rb | 11 ++---------
 1 file 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 @@ def wbuf_flush(client)
       @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)
-- 
EW

--
unsubscribe: [email protected]
archive: https://yhbt.net/yahns-public/

Reply via email to