about summary refs log tree commit homepage
path: root/lib/yahns/proxy_pass.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/proxy_pass.rb')
-rw-r--r--lib/yahns/proxy_pass.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb
index 511db02..148957b 100644
--- a/lib/yahns/proxy_pass.rb
+++ b/lib/yahns/proxy_pass.rb
@@ -63,7 +63,8 @@ class Yahns::ProxyPass # :nodoc:
 
         when Yahns::WbufCommon # streaming/buffering the response body
 
-          return c.proxy_response_finish(req, resbuf, self)
+          # we assign wbuf for rescue below:
+          return c.proxy_response_finish(req, wbuf = resbuf, self)
 
         end while true # case @resbuf
 
@@ -79,7 +80,7 @@ class Yahns::ProxyPass # :nodoc:
       when Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EPIPE
         e.set_backtrace([])
       end
-      c.proxy_err_response(502, self, e, nil)
+      c.proxy_err_response(502, self, e, wbuf)
     end
 
     # returns :wait_readable if complete, :wait_writable if not