diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-11-19 18:55:06 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-11-19 18:55:06 -0800 |
commit | a5986295bfb7bd7c44c863e4670f16481097c7fc (patch) | |
tree | 7a4e4b0fd0a359728af531f468cb0b7879d0fe5e /lib/rainbows/revactor.rb | |
parent | da9dfc1dece4fbcdf2a8e8ccdb4914ce4aa3a998 (diff) | |
download | rainbows-a5986295bfb7bd7c44c863e4670f16481097c7fc.tar.gz |
Oops, last commit was rushed
Diffstat (limited to 'lib/rainbows/revactor.rb')
-rw-r--r-- | lib/rainbows/revactor.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index 9569d3e..59f37b0 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -43,6 +43,7 @@ module Rainbows::Revactor end hp = Unicorn::HttpParser.new buf = hp.buf + alive = false begin until env = hp.parse @@ -64,12 +65,12 @@ module Rainbows::Revactor if hp.headers? headers = HH.new(headers) range = make_range!(env, status, headers) and status = range.shift - env = hp.next? && G.alive && G.kato > 0 - headers[CONNECTION] = env ? KEEP_ALIVE : CLOSE + alive = hp.next? && G.alive && G.kato > 0 + headers[CONNECTION] = alive ? KEEP_ALIVE : CLOSE client.write(response_header(status, headers)) end write_body(client, body, range) - end while env + end while alive rescue ::Revactor::TCP::ReadError rescue => e Rainbows::Error.write(io, e) |