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/process_client.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/rainbows/process_client.rb') diff --git a/lib/rainbows/process_client.rb b/lib/rainbows/process_client.rb index 271185d..54e59e8 100644 --- a/lib/rainbows/process_client.rb +++ b/lib/rainbows/process_client.rb @@ -4,7 +4,7 @@ require 'rainbows/rack_input' module Rainbows::ProcessClient G = Rainbows::G include Rainbows::Response - HttpParser = Unicorn::HttpParser + HttpParser = Rainbows::HttpParser include Rainbows::RackInput include Rainbows::Const @@ -37,8 +37,7 @@ module Rainbows::ProcessClient if hp.headers? headers = HH.new(headers) range = make_range!(env, status, headers) and status = range.shift - alive = hp.next? && G.alive - headers[CONNECTION] = alive ? KEEP_ALIVE : CLOSE + headers[CONNECTION] = (alive = hp.next?) ? KEEP_ALIVE : CLOSE client.write(response_header(status, headers)) end write_body(client, body, range) -- cgit v1.2.3-24-ge0c7