From 395ed76a9916c850749a65d2a9040e39b803414d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 27 Apr 2016 00:27:01 +0000 Subject: wbuf: drop persistence if writing to client fails 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). --- lib/yahns/wbuf_common.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') 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 -- cgit v1.2.3-24-ge0c7