From e166cfe5e8d648b544b1291ec157bd234a425e21 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 8 Feb 2013 22:45:20 +0000 Subject: hijacking support for Rack 1.5.x users This requires Rack 1.5.x and unicorn 4.6.0 for hijacking support. Older versions of Rack continue to work fine, but we must use unicorn 4.6.0 features to support this. --- lib/rainbows/coolio/thread_client.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/rainbows/coolio/thread_client.rb') diff --git a/lib/rainbows/coolio/thread_client.rb b/lib/rainbows/coolio/thread_client.rb index abc11d2..ee9fa04 100644 --- a/lib/rainbows/coolio/thread_client.rb +++ b/lib/rainbows/coolio/thread_client.rb @@ -14,6 +14,7 @@ class Rainbows::Coolio::ThreadClient < Rainbows::Coolio::Client # this is only called in the master thread def response_write(response) + return hijacked if @hp.hijacked? ev_write_response(*response, @hp.next?) rescue => e handle_error(e) @@ -25,6 +26,7 @@ class Rainbows::Coolio::ThreadClient < Rainbows::Coolio::Client def app_response begin @env[REMOTE_ADDR] = @_io.kgio_addr + @hp.hijack_setup(@env, @_io) APP.call(@env.merge!(RACK_DEFAULTS)) rescue => e Rainbows::Error.app(e) # we guarantee this does not raise -- cgit v1.2.3-24-ge0c7