From fedb5e50829e6dfad30ca18ea525c812eccbec70 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 22 Jan 2013 23:52:14 +0000 Subject: ignore normal Rack response at request-time hijack Once a connection is hijacked, we ignore it completely and leave the connection at the mercy of the application. --- lib/unicorn/http_server.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/unicorn/http_server.rb') diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 2d8e4e1..cc0a705 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -550,11 +550,13 @@ class Unicorn::HttpServer # in 3 easy steps: read request, call app, write app response def process_client(client) status, headers, body = @app.call(env = @request.read(client)) + return if @request.hijacked? if 100 == status.to_i client.write(expect_100_response) env.delete(Unicorn::Const::HTTP_EXPECT) status, headers, body = @app.call(env) + return if @request.hijacked? end @request.headers? or headers = nil http_response_write(client, status, headers, body, -- cgit v1.2.3-24-ge0c7