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 961E020708; Tue, 5 Jul 2016 13:50:20 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Cc: Eric Wong Subject: [PATCH 2/3] proxy_pass: avoid accessing logger in env after hijacking Date: Tue, 5 Jul 2016 13:50:15 +0000 Message-Id: <20160705135016.14274-3-e@80x24.org> In-Reply-To: <20160705135016.14274-1-e@80x24.org> References: <20160705135016.14274-1-e@80x24.org> List-Id: The HTTP state (@hs) object could be replaced in proxy_wait_next causing @hs.env['rack.logger'] to become inaccessible. --- lib/yahns/proxy_http_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb index a37b387..74f5ce5 100644 --- a/lib/yahns/proxy_http_response.rb +++ b/lib/yahns/proxy_http_response.rb @@ -46,7 +46,7 @@ def proxy_write(wbuf, buf, req_res) end def proxy_err_response(code, req_res, exc) - logger = @hs.env['rack.logger'] + logger = self.class.logger # Yahns::HttpContext#logger case exc when nil logger.error('premature upstream EOF') -- EW