about summary refs log tree commit homepage
path: root/lib/yahns/http_client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/http_client.rb')
-rw-r--r--lib/yahns/http_client.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index 272db85..1d64e08 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -22,8 +22,7 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
     case rv = @state.wbuf_flush(self)
     when :wait_writable, :wait_readable
       return rv # tell epoll/kqueue to wait on this more
-    when :ignore # :ignore on hijack
-      @state = :ignore
+    when :ignore # :ignore on hijack, @state already set in hijack_cleanup
       return :ignore
     when Yahns::StreamFile
       @state = rv # continue looping
@@ -254,8 +253,9 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
   # (and complicated) as our hijack support will allow "un-hijacking"
   # the socket.
   def hijack_cleanup
-    # prevent socket from holding process up
+    # prevent socket from holding process exit up
     Thread.current[:yahns_fdmap].forget(self)
+    @state = :ignore
     @input = nil # keep env["rack.input"] accessible, though
   end