about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/yahns/wbuf_lite.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/yahns/wbuf_lite.rb b/lib/yahns/wbuf_lite.rb
index fa52f54..25daf21 100644
--- a/lib/yahns/wbuf_lite.rb
+++ b/lib/yahns/wbuf_lite.rb
@@ -33,10 +33,14 @@ class Yahns::WbufLite < Yahns::Wbuf # :nodoc:
   def wbuf_close(client)
     wbuf_abort
 
-    # resume reading when @blocked is empty
+    # resume the event loop when @blocked is empty
+    # The actual Yahns::ReqRes#yahns_step is actually read/write-event
+    # agnostic, and we should actually watch for writability here since
+    # the req_res socket itself could be completely drained of readable
+    # data and just waiting for another request (which we don't support, yet)
     if @req_res
       client.hijack_cleanup
-      Thread.current[:yahns_queue].queue_mod(@req_res, Yahns::Queue::QEV_RD)
+      Thread.current[:yahns_queue].queue_mod(@req_res, Yahns::Queue::QEV_WR)
       return :ignore
     end
     @wbuf_persist