From 1a2a82721bf845a3f7e7a3972bc0f41befb25c41 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2015 02:47:25 +0000 Subject: http_parser: workaround hijack changes in unicorn 5 unicorn lost the hijack_setup method in version 5, so we must recreate it ourselves. --- lib/rainbows/http_parser.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/rainbows/http_parser.rb') diff --git a/lib/rainbows/http_parser.rb b/lib/rainbows/http_parser.rb index 30a67cb..bcf1dba 100644 --- a/lib/rainbows/http_parser.rb +++ b/lib/rainbows/http_parser.rb @@ -17,6 +17,15 @@ class Rainbows::HttpParser < Unicorn::HttpParser super end + def hijack_setup(io) + @hijack_io = io + env['rack.hijack'] = self # avoid allocating a new proc this way + end + + def call # for rack.hijack + env['rack.hijack_io'] = @hijack_io + end + def self.quit alias_method :next?, :never! end -- cgit v1.2.3-24-ge0c7