From 7bfd7995fd403f80940e3f6ac36f9ae58b7040cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Dec 2010 03:30:36 +0000 Subject: avoid HttpParser#keepalive? and HttpParser#reset The HttpParser#next? method will come with keepalive protection for Rainbows!, which can prevent clients from monopolizing a server with excessive pipelining/keepalive requests. --- lib/rainbows/rev/thread.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/rainbows/rev/thread.rb') diff --git a/lib/rainbows/rev/thread.rb b/lib/rainbows/rev/thread.rb index 2356ae2..0f36ce5 100644 --- a/lib/rainbows/rev/thread.rb +++ b/lib/rainbows/rev/thread.rb @@ -20,11 +20,10 @@ module Rainbows # this is only called in the master thread def response_write(response) - alive = @hp.keepalive? && G.alive + alive = @hp.next? && G.alive rev_write_response(response, alive) return quit unless alive && :close != @state - @hp.reset @state = :headers end -- cgit v1.2.3-24-ge0c7