about summary refs log tree commit homepage
path: root/lib/rainbows/http_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/http_parser.rb')
-rw-r--r--lib/rainbows/http_parser.rb9
1 files changed, 9 insertions, 0 deletions
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