about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rainbows/event_machine.rb3
-rw-r--r--lib/rainbows/rev.rb3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 5c25ade..7f77428 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -53,7 +53,6 @@ module Rainbows
       def app_call
         begin
           (@env[RACK_INPUT] = @input).rewind
-          alive = @hp.keepalive?
           @env[REMOTE_ADDR] = @remote_addr
           @env[ASYNC_CALLBACK] = method(:response_write)
 
@@ -64,7 +63,7 @@ module Rainbows
           # long-running async response
           (response.nil? || -1 == response.first) and return @state = :close
 
-          alive &&= G.alive
+          alive = @hp.keepalive? && G.alive
           out = [ alive ? CONN_ALIVE : CONN_CLOSE ] if @hp.headers?
           response_write(response, out, alive)
 
diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb
index 66f6ed1..0d8b6c9 100644
--- a/lib/rainbows/rev.rb
+++ b/lib/rainbows/rev.rb
@@ -49,10 +49,9 @@ module Rainbows
       def app_call
         begin
           (@env[RACK_INPUT] = @input).rewind
-          alive = @hp.keepalive?
           @env[REMOTE_ADDR] = @remote_addr
           response = APP.call(@env.update(RACK_DEFAULTS))
-          alive &&= G.alive
+          alive = @hp.keepalive? && G.alive
           out = [ alive ? CONN_ALIVE : CONN_CLOSE ] if @hp.headers?
 
           DeferredResponse.write(self, response, out)