about summary refs log tree commit homepage
path: root/lib/rainbows
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-24 01:12:16 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-24 01:12:16 -0800
commit9cc509bda610fa5ca8c642cdcf480835b8dfc468 (patch)
treec4643afe0878a00092b40de5bf01a1314bd15453 /lib/rainbows
parent77f930cb64d32b3fac942b462cf4c7a04af730e3 (diff)
downloadrainbows-9cc509bda610fa5ca8c642cdcf480835b8dfc468.tar.gz
No point in rewinding the NULL_IO especially when most requests
use them instead of bodies that actually have something.
Diffstat (limited to 'lib/rainbows')
-rw-r--r--lib/rainbows/ev_core.rb1
-rw-r--r--lib/rainbows/event_machine.rb2
-rw-r--r--lib/rainbows/rev/client.rb2
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index 017fe5c..e0fb029 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -74,6 +74,7 @@ module Rainbows
         end
       when :trailers
         if @hp.trailers(@env, @buf << data)
+          @input.rewind
           app_call
           @input.close if File === @input
         end
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 54c1bc0..b099721 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -53,7 +53,7 @@ module Rainbows
       def app_call
         set_comm_inactivity_timeout 0
         begin
-          (@env[RACK_INPUT] = @input).rewind
+          @env[RACK_INPUT] = @input
           @env[REMOTE_ADDR] = @remote_addr
           @env[ASYNC_CALLBACK] = method(:response_write)
 
diff --git a/lib/rainbows/rev/client.rb b/lib/rainbows/rev/client.rb
index b30bd0e..f7a9750 100644
--- a/lib/rainbows/rev/client.rb
+++ b/lib/rainbows/rev/client.rb
@@ -30,7 +30,7 @@ module Rainbows
       def app_call
         begin
           KATO.delete(self)
-          (@env[RACK_INPUT] = @input).rewind
+          @env[RACK_INPUT] = @input
           @env[REMOTE_ADDR] = @remote_addr
           response = APP.call(@env.update(RACK_DEFAULTS))
           alive = @hp.keepalive? && G.alive