about summary refs log tree commit homepage
path: root/lib/rainbows/stream_response_epoll.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-14 02:47:24 +0000
committerEric Wong <e@80x24.org>2015-11-18 02:20:25 +0000
commit70c976bdd85bb8515fea01d6ad6074ef472fc2e0 (patch)
tree51230dc24bb183176b932e0d38e181869b5485e7 /lib/rainbows/stream_response_epoll.rb
parent9c9e3949b2ef2f299ff1590d23aa4d053b60a2fd (diff)
downloadrainbows-70c976bdd85bb8515fea01d6ad6074ef472fc2e0.tar.gz
Unicorn 5 removes some constants we were using, and constant
lookups + inline caching are waste of time anyways on newer
Rubies with the opt_str_freeze bytecode instruction.

This may reduce performance for folks on older Rubies (probably
not noticeable); but improves performance for folks on newer
Rubies.
Diffstat (limited to 'lib/rainbows/stream_response_epoll.rb')
-rw-r--r--lib/rainbows/stream_response_epoll.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/rainbows/stream_response_epoll.rb b/lib/rainbows/stream_response_epoll.rb
index 1f32dcc..c36acaf 100644
--- a/lib/rainbows/stream_response_epoll.rb
+++ b/lib/rainbows/stream_response_epoll.rb
@@ -20,7 +20,6 @@ require "raindrops"
 # * sleepy_penguin 3.0.1 or later
 module Rainbows::StreamResponseEpoll
   # :stopdoc:
-  HEADER_END = "X-Accel-Buffering: no\r\n\r\n"
   autoload :Client, "rainbows/stream_response_epoll/client"
 
   def http_response_write(socket, status, headers, body)
@@ -46,7 +45,7 @@ module Rainbows::StreamResponseEpoll
           end
         end
       end
-      buf << HEADER_END
+      buf << "X-Accel-Buffering: no\r\n\r\n".freeze
 
       case rv = socket.kgio_trywrite(buf)
       when nil then break
@@ -101,8 +100,8 @@ module Rainbows::StreamResponseEpoll
     status, headers, body = @app.call(env = @request.read(client))
 
     if 100 == status.to_i
-      client.write(Unicorn::Const::EXPECT_100_RESPONSE)
-      env.delete(Unicorn::Const::HTTP_EXPECT)
+      client.write("HTTP/1.1 100 Continue\r\n\r\n".freeze)
+      env.delete('HTTP_EXPECT'.freeze)
       status, headers, body = @app.call(env)
     end
     @request.headers? or headers = nil