about summary refs log tree commit homepage
path: root/lib/yahns/http_response.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-11-07 18:15:26 +0000
committerEric Wong <e@80x24.org>2013-11-07 18:15:26 +0000
commit0258cd5dd91241931cca08048ab0a2067e323ee6 (patch)
treeb1ec07e13b4d038a0084890a57815b6c97742c5b /lib/yahns/http_response.rb
parentd9b7a620f43fe815c5ddbf341a73b51bd0e7da8a (diff)
downloadyahns-0258cd5dd91241931cca08048ab0a2067e323ee6.tar.gz
Simultaneously waiting for both readability and writability is
likely unnecessary.  Sockets become writable much more commonly,
and if we need to read, we'll issue a read the next time it enters
yahns_step (after it becomes writable).

Also, this makes kqueue easier-to-implement as I don't believe it
implements a way to combine EVFILT_READ with EVFILT_WRITE
(especially not safely while relying on EV_ONESHOT behavior).
Diffstat (limited to 'lib/yahns/http_response.rb')
-rw-r--r--lib/yahns/http_response.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index 8a2426b..7207bd1 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -81,9 +81,9 @@ module Yahns::HttpResponse # :nodoc:
         :wait_readable
       else
         @state = :pipelined
-        # may need to wait for readability if SSL,
-        # only need writability if plain TCP
-        :wait_readwrite
+        # we shouldn't start processing the application again until we know
+        # the socket is writable for the response
+        :wait_writable
       end
     else
       # shutdown is needed in case the app forked, we rescue here since