about summary refs log tree commit homepage
path: root/lib/rainbows/rev/thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/rev/thread.rb')
-rw-r--r--lib/rainbows/rev/thread.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/rainbows/rev/thread.rb b/lib/rainbows/rev/thread.rb
index 2dbaa84..cce3e92 100644
--- a/lib/rainbows/rev/thread.rb
+++ b/lib/rainbows/rev/thread.rb
@@ -13,28 +13,20 @@ module Rainbows
 
       def app_call
         KATO.delete(self)
-        disable
+        disable if enabled?
         @env[RACK_INPUT] = @input
         app_dispatch # must be implemented by subclass
       end
 
       # this is only called in the master thread
       def response_write(response)
-        enable
         alive = @hp.keepalive? && G.alive
         rev_write_response(response, alive)
-        return quit unless alive
+        return quit unless alive && :close != @state
 
         @env.clear
         @hp.reset
         @state = :headers
-        # keepalive requests are always body-less, so @input is unchanged
-        if @hp.headers(@env, @buf)
-          @input = HttpRequest::NULL_IO
-          app_call
-        else
-          KATO[self] = Time.now
-        end
       end
 
       # fails-safe application dispatch, we absolutely cannot