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.3 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 49480633828 for ; Wed, 27 Apr 2016 00:27:16 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH 3/5] proxy_http_response: cleanup: avoid redundant setting of "alive" Date: Wed, 27 Apr 2016 00:27:02 +0000 Message-Id: <20160427002704.10660-4-e@80x24.org> In-Reply-To: <20160427002704.10660-1-e@80x24.org> References: <20160427002704.10660-1-e@80x24.org> List-Id: We already check for the truthiness of "alive" in the "if" statement, so re-setting is pointless. --- lib/yahns/proxy_http_response.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb index c8a2a42..e551323 100644 --- a/lib/yahns/proxy_http_response.rb +++ b/lib/yahns/proxy_http_response.rb @@ -101,7 +101,6 @@ def proxy_response_start(res, tip, kcar, req_res) # but the backend does not terminate properly if alive && ! term && (env['HTTP_VERSION'] == 'HTTP/1.1'.freeze) res << "Transfer-Encoding: chunked\r\n".freeze - alive = true end res << (alive ? "Connection: keep-alive\r\n\r\n".freeze : "Connection: close\r\n\r\n".freeze) -- EW