diff options
-rw-r--r-- | lib/rainbows/event_machine/client.rb | 8 |
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! |