about summary refs log tree commit homepage
path: root/lib/rainbows/event_machine.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-08-28 06:50:51 +0000
committerEric Wong <normalperson@yhbt.net>2010-08-28 06:53:12 +0000
commit32d3b1f052810eb15362d001d1501be0e2da88d8 (patch)
tree3e36ef1c071eb736c431d0972a24024ba2347aa9 /lib/rainbows/event_machine.rb
parent108d6afd7ff390bb594c99ba23c91163fa98d8c0 (diff)
downloadrainbows-32d3b1f052810eb15362d001d1501be0e2da88d8.tar.gz
Although this behavior is mentioned on the documentation,
this was broken under EventMachine, Rev*, and Revactor.

Furthermore, we set the "Connection: close" header to allow the
client to optimize is handling of non-keepalive connections.
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