From 72a315441937f9e0531112f2b7080da39ca6064d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 Dec 2010 08:32:24 +0000 Subject: simplify per-client keepalive state checks This lets us simplify repetitive checks worry less about properly maintaining/closing client connections for each concurrency model we support. --- lib/rainbows/revactor.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/rainbows/revactor.rb') diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index d996243..f4e8fca 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -42,7 +42,7 @@ module Rainbows::Revactor else LOCALHOST end - hp = Unicorn::HttpParser.new + hp = Rainbows::HttpParser.new buf = hp.buf alive = false @@ -67,8 +67,7 @@ module Rainbows::Revactor if hp.headers? headers = HH.new(headers) range = make_range!(env, status, headers) and status = range.shift - alive = hp.next? && G.alive && G.kato > 0 - headers[CONNECTION] = alive ? KEEP_ALIVE : CLOSE + headers[CONNECTION] = (alive = hp.next?) ? KEEP_ALIVE : CLOSE client.write(response_header(status, headers)) alive && ts and buf << ts.leftover end -- cgit v1.2.3-24-ge0c7