diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-19 10:10:04 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-19 17:04:34 -0700 |
commit | ed14b9bdbb35fa18dc283ba2d048a33d10759b2d (patch) | |
tree | d01c589b2eea1f6b05069e49fdb7988444949eec /lib/rainbows/rev/client.rb | |
parent | be17361f835840c7e356dbb75a6dfcafba6d0ebf (diff) | |
download | rainbows-ed14b9bdbb35fa18dc283ba2d048a33d10759b2d.tar.gz |
Similar to what we do in EM, this avoid unnecessary conditional logic inside more frequently used code paths.
Diffstat (limited to 'lib/rainbows/rev/client.rb')
-rw-r--r-- | lib/rainbows/rev/client.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/rev/client.rb b/lib/rainbows/rev/client.rb index 5c61109..4d1aaec 100644 --- a/lib/rainbows/rev/client.rb +++ b/lib/rainbows/rev/client.rb @@ -62,10 +62,10 @@ module Rainbows # used for streaming sockets and pipes def stream_response(status, headers, io, body) - do_chunk = stream_response_headers(status, headers) if headers + c = stream_response_headers(status, headers) if headers # we only want to attach to the Rev::Loop belonging to the # main thread in Ruby 1.9 - io = DeferredResponse.new(io, self, do_chunk, body) + io = (c ? DeferredChunkResponse : DeferredResponse).new(io, self, body) defer_body(io.attach(Server::LOOP)) end |