about summary refs log tree commit homepage
path: root/lib/rainbows/rev/client.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-26 03:30:36 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-26 09:53:30 +0000
commit7bfd7995fd403f80940e3f6ac36f9ae58b7040cb (patch)
treee5822c83d2e429d893461dc32d4f0478ea281525 /lib/rainbows/rev/client.rb
parent92a11cdfe00c5e551388c2cc1a62bfc59d568c6f (diff)
downloadrainbows-7bfd7995fd403f80940e3f6ac36f9ae58b7040cb.tar.gz
The HttpParser#next? method will come with keepalive protection
for Rainbows!, which can prevent clients from monopolizing a
server with excessive pipelining/keepalive requests.
Diffstat (limited to 'lib/rainbows/rev/client.rb')
-rw-r--r--lib/rainbows/rev/client.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/rev/client.rb b/lib/rainbows/rev/client.rb
index b212f5c..8c39792 100644
--- a/lib/rainbows/rev/client.rb
+++ b/lib/rainbows/rev/client.rb
@@ -125,9 +125,8 @@ class Rainbows::Rev::Client < ::Rev::IO
     @env[REMOTE_ADDR] = @_io.kgio_addr
     response = APP.call(@env.update(RACK_DEFAULTS))
 
-    rev_write_response(response, alive = @hp.keepalive? && G.alive)
+    rev_write_response(response, alive = @hp.next? && G.alive)
     return quit unless alive && :close != @state
-    @hp.reset
     @state = :headers
     disable if enabled?
   end