From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7AB832079C for ; Sat, 12 Nov 2016 01:37:32 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] req_res: do not send 502 on catchall error if response buffered Date: Sat, 12 Nov 2016 01:37:32 +0000 Message-Id: <20161112013732.32687-1-e@80x24.org> List-Id: If we already started writing a response, we cannot be sending a 502 to inform a user a connection has failed. This should prevent errors from the OpenSSL layer about mismatched buffers due to the combination of slow clients and upstreams prematurely aborting. --- lib/yahns/req_res.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/req_res.rb b/lib/yahns/req_res.rb index 041b908..4ad8e5c 100644 --- a/lib/yahns/req_res.rb +++ b/lib/yahns/req_res.rb @@ -76,7 +76,7 @@ def yahns_step # yahns event loop entry point when Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EPIPE e.set_backtrace([]) end - c.proxy_err_response(502, self, e) + c.proxy_err_response(Yahns::WbufCommon === @resbuf ? nil : 502, self, e) end def send_req_body_chunk(buf) -- EW