yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] proxy_pass: capture local variable earlier for rescue
@ 2015-04-09 22:21 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-04-09 22:21 UTC (permalink / raw)
  To: yahns-public

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-09 22:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 22:21 [PATCH] proxy_pass: capture local variable earlier for rescue Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).