about summary refs log tree commit homepage
path: root/lib/yahns/http_client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/http_client.rb')
-rw-r--r--lib/yahns/http_client.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index 0c656e8..9a37811 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -11,12 +11,6 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
   include Yahns::HttpResponse
   QEV_FLAGS = Yahns::Queue::QEV_RD # used by acceptor
 
-  # A frozen format for this is about 15% faster (note from Mongrel)
-  REMOTE_ADDR = 'REMOTE_ADDR'.freeze
-  RACK_INPUT = 'rack.input'.freeze
-  RACK_HIJACK = 'rack.hijack'.freeze
-  RACK_HIJACK_IO = "rack.hijack_io".freeze
-
   # called from acceptor thread
   def yahns_init
     @hs = Unicorn::HttpRequest.new
@@ -206,9 +200,9 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
     # input is nil if we needed to wait for writability with
     # check_client_connection
     if input
-      env[REMOTE_ADDR] = @kgio_addr
-      env[RACK_HIJACK] = self
-      env[RACK_INPUT] = input
+      env['REMOTE_ADDR'] = @kgio_addr
+      env['rack.hijack'] = self
+      env['rack.input'] = input
 
       if k.check_client_connection && @hs.headers?
         rv = do_ccc and return rv
@@ -262,7 +256,7 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
   # this is the env["rack.hijack"] callback exposed to the Rack app
   def call
     hijack_cleanup
-    @hs.env[RACK_HIJACK_IO] = self
+    @hs.env['rack.hijack_io'] = self
   end
 
   def response_hijacked(fn)
@@ -300,7 +294,7 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
   end
 
   def app_hijacked?(env, body)
-    return false unless env.include?(RACK_HIJACK_IO)
+    return false unless env.include?('rack.hijack_io'.freeze)
     body.close if body.respond_to?(:close)
     true
   end