about summary refs log tree commit homepage
path: root/lib/rainbows/rev/deferred_response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-19 10:10:04 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-19 17:04:34 -0700
commited14b9bdbb35fa18dc283ba2d048a33d10759b2d (patch)
treed01c589b2eea1f6b05069e49fdb7988444949eec /lib/rainbows/rev/deferred_response.rb
parentbe17361f835840c7e356dbb75a6dfcafba6d0ebf (diff)
downloadrainbows-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/deferred_response.rb')
-rw-r--r--lib/rainbows/rev/deferred_response.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/rainbows/rev/deferred_response.rb b/lib/rainbows/rev/deferred_response.rb
index f0172d6..13396d8 100644
--- a/lib/rainbows/rev/deferred_response.rb
+++ b/lib/rainbows/rev/deferred_response.rb
@@ -4,19 +4,16 @@
 # this is class is specific to Rev for writing large static files
 # or proxying IO-derived objects
 class Rainbows::Rev::DeferredResponse < ::Rev::IO
-  def initialize(io, client, do_chunk, body)
+  def initialize(io, client, body)
     super(io)
-    @client, @do_chunk, @body = client, do_chunk, body
+    @client, @body = client, body
   end
 
   def on_read(data)
-    @do_chunk and @client.write("#{data.size.to_s(16)}\r\n")
     @client.write(data)
-    @do_chunk and @client.write("\r\n")
   end
 
   def on_close
-    @do_chunk and @client.write("0\r\n\r\n")
     @client.next
     @body.respond_to?(:close) and @body.close
   end