about summary refs log tree commit homepage
path: root/lib/unicorn/http_request.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-29 18:01:41 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-29 18:17:36 -0700
commit41f6f65a6cb7152b5181704373d7da62704a62e8 (patch)
tree7ca9dd0d8618e11e42ca591b96d8b4f1d3f7942a /lib/unicorn/http_request.rb
parent4f05fb1a3b44f8eab1a9dda26d5b115f33a149cd (diff)
downloadunicorn-41f6f65a6cb7152b5181704373d7da62704a62e8.tar.gz
This won't be heavily used enough to make preallocation worth
the effort.  While we're at it, don't enforce policy by forcing
the readpartial buffer to be Encoding::BINARY (even though it
/should/ be :), it's up to the user of the interface to decide.
Diffstat (limited to 'lib/unicorn/http_request.rb')
-rw-r--r--lib/unicorn/http_request.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb
index b1cd8ed..b2c72f3 100644
--- a/lib/unicorn/http_request.rb
+++ b/lib/unicorn/http_request.rb
@@ -22,7 +22,6 @@ module Unicorn
     }
 
     NULL_IO = StringIO.new(Z)
-    DECHUNKER = ChunkedReader.new
     LOCALHOST = '127.0.0.1'.freeze
 
     # Being explicitly single-threaded, we have certain advantages in
@@ -93,7 +92,7 @@ module Unicorn
 
         if te = PARAMS[Const::HTTP_TRANSFER_ENCODING]
           if /chunked/i =~ te
-            socket = DECHUNKER.reopen(socket, body)
+            socket = ChunkedReader.new(socket, body)
             length = body = nil
           end
         end