about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-04-03 22:04:52 +0000
committerEric Wong <e@80x24.org>2015-04-03 22:04:52 +0000
commitdb0f20a4c889a132786af69a6aaacfadf689379d (patch)
treefd8f75165536fadb5d026ae2e6951267ebe68728 /lib
parent78f23338ef08fe98e7d90d35ba1f8356de51e3d4 (diff)
downloadyahns-db0f20a4c889a132786af69a6aaacfadf689379d.tar.gz
We were incorrectly stashing the return value of detach_rbuf!
into the inter-thread buffer buffer which is bound to the client.
Diffstat (limited to 'lib')
-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 09fb884..ec1fbcf 100644
--- a/lib/yahns/proxy_pass.rb
+++ b/lib/yahns/proxy_pass.rb
@@ -108,7 +108,7 @@ class Yahns::ProxyPass # :nodoc:
           when Array
             vec = rv # partial write, retry in case loop
           when :wait_writable
-            buf = detach_rbuf!
+            detach_rbuf!
             req[0] = vec
             return :wait_writable
           when nil
@@ -120,13 +120,14 @@ class Yahns::ProxyPass # :nodoc:
         # note: we do not send any trailer, they are folded into the header
         # because this relies on full request buffering
         send_req_buf("0\r\n\r\n".freeze)
+        # prepare_wait_readable already called by send_req_buf
       else # identity request, easy:
         while input.read(0x2000, buf)
           case rv = kgio_trywrite(buf)
           when String
             buf = rv # partial write, retry in case loop
           when :wait_writable
-            buf = detach_rbuf!
+            detach_rbuf!
             req[0] = buf
             return :wait_writable
           when nil