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: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: yahns-public@yhbt.net Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6517F1F488 for ; Thu, 9 Apr 2015 22:21:10 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] proxy_pass: capture local variable earlier for rescue Date: Thu, 9 Apr 2015 22:21:10 +0000 Message-Id: <1428618070-17994-1-git-send-email-e@80x24.org> List-Id: This giant method needs to spew an error response in case uploads to the upstream fail, ensure the local variable is defined early. --- lib/yahns/proxy_pass.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 1b8eed7..d02bb40 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -28,10 +28,10 @@ def detach_rbuf! end def yahns_step # yahns event loop entry point + c = @yahns_client case req = @rrstate when Kcar::Parser # reading response... buf = Thread.current[:yahns_rbuf] - c = @yahns_client case resbuf = @resbuf # where are we at the response? when nil # common case, catch the response header in a single read -- EW