about summary refs log tree commit homepage
path: root/lib/rainbows/event_machine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/event_machine.rb')
-rw-r--r--lib/rainbows/event_machine.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 2a41015..cf59cbf 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -95,7 +95,8 @@ module Rainbows
         # long-running async response
         (response.nil? || -1 == response[0]) and return @state = :close
 
-        em_write_response(response, alive = @hp.keepalive? && G.alive)
+        alive = @hp.keepalive? && G.alive && G.kato > 0
+        em_write_response(response, alive)
         if alive
           @env.clear
           @hp.reset