about summary refs log tree commit homepage
path: root/lib/rainbows/event_machine
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-07 16:12:26 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-07 16:12:26 -0800
commit7e4a7225dbd01df27a6b3ec44e53c013b889a724 (patch)
tree0feeb47a6ec71c396aae8a9da5c72c8052468ef2 /lib/rainbows/event_machine
parent9d2fdee38f990e44b3a232c27f51287173e60e91 (diff)
downloadrainbows-7e4a7225dbd01df27a6b3ec44e53c013b889a724.tar.gz
Since we support keepalive now, setting @state can be
harmful and the comment is out-of-date.
Diffstat (limited to 'lib/rainbows/event_machine')
-rw-r--r--lib/rainbows/event_machine/client.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/rainbows/event_machine/client.rb b/lib/rainbows/event_machine/client.rb
index 22e5360..ff77d2b 100644
--- a/lib/rainbows/event_machine/client.rb
+++ b/lib/rainbows/event_machine/client.rb
@@ -39,16 +39,12 @@ class Rainbows::EventMachine::Client < EM::Connection
     @env[REMOTE_ADDR] = @_io.kgio_addr
     @env[ASYNC_CALLBACK] = method(:write_async_response)
     @env[ASYNC_CLOSE] = EM::DefaultDeferrable.new
-
     status, headers, body = catch(:async) {
       APP.call(@env.merge!(RACK_DEFAULTS))
     }
 
-    # too tricky to support pipelining with :async since the
-    # second (pipelined) request could be a stuck behind a
-    # long-running async response
-    (status.nil? || -1 == status) and return @state = :close
-    write_response(status, headers, body, @hp.next?)
+    (nil == status || -1 == status) or
+      write_response(status, headers, body, @hp.next?)
   end
 
   def next!