From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS30633 207.244.64.0/18 X-Spam-Status: No, score=-0.4 required=3.0 tests=AWL,BAYES_00, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_XBL,RDNS_NONE,SPF_FAIL,SPF_HELO_FAIL shortcircuit=no autolearn=no version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from 80x24.org (unknown [207.244.70.35]) by dcvr.yhbt.net (Postfix) with ESMTP id B2E83633822 for ; Wed, 27 Apr 2016 00:27:15 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH 2/5] wbuf: drop persistence if writing to client fails Date: Wed, 27 Apr 2016 00:27:01 +0000 Message-Id: <20160427002704.10660-3-e@80x24.org> In-Reply-To: <20160427002704.10660-1-e@80x24.org> References: <20160427002704.10660-1-e@80x24.org> List-Id: 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(+) 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 @@ def wbuf_flush(client) end while @sf_count > 0 wbuf_close(client) rescue + @wbuf_persist = false # ensure a hijack response is not called wbuf_close(client) raise end -- EW