about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-27 00:27:01 +0000
committerEric Wong <e@80x24.org>2016-04-27 00:29:24 +0000
commit395ed76a9916c850749a65d2a9040e39b803414d (patch)
tree5689bf814f0fbb6286d17b6502b18aea6e0cceef
parentb079c1d346cba2d169006227cee8e9fa7fdab213 (diff)
downloadyahns-395ed76a9916c850749a65d2a9040e39b803414d.tar.gz
We cannot maintain a persistent connection to a client if
writing to the client fails; so we can't proceed to let
the app hijack the response.

This may happen in the unlikely case where a response
header needs to be buffered with a Wbuf (and the app
uses response hijacking).
-rw-r--r--lib/yahns/wbuf_common.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/yahns/wbuf_common.rb b/lib/yahns/wbuf_common.rb
index c51050b..ee18218 100644
--- a/lib/yahns/wbuf_common.rb
+++ b/lib/yahns/wbuf_common.rb
@@ -38,6 +38,7 @@ module Yahns::WbufCommon # :nodoc:
     end while @sf_count > 0
     wbuf_close(client)
   rescue
+    @wbuf_persist = false # ensure a hijack response is not called
     wbuf_close(client)
     raise
   end