diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-12-07 01:03:00 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-12-07 01:05:18 -0800 |
commit | 49e4ffcc7ca3f1039a27c9ae884dd6c6ae23df41 (patch) | |
tree | 0cfadb38325c6a5b8762d477df185db228656703 /lib/unicorn | |
parent | e8970141039b8ab99c1b7fe3f54d2072dace62de (diff) | |
download | unicorn-49e4ffcc7ca3f1039a27c9ae884dd6c6ae23df41.tar.gz |
No point in bloating code for an unlikely path (and the memcpy() vs malloc() tradeoff is debatable...)
Diffstat (limited to 'lib/unicorn')
-rw-r--r-- | lib/unicorn/http_request.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 1d978e6..31fcc3d 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -57,12 +57,10 @@ module Unicorn # short circuit the common case with small GET requests first if PARSER.headers(REQ, socket.readpartial(Const::CHUNK_SIZE, BUF)).nil? - data = BUF.dup # socket.readpartial will clobber data - # Parser is not done, queue up more data to read and continue parsing # an Exception thrown from the PARSER will throw us out of the loop begin - BUF << socket.readpartial(Const::CHUNK_SIZE, data) + BUF << socket.readpartial(Const::CHUNK_SIZE) end while PARSER.headers(REQ, BUF).nil? end REQ[Const::RACK_INPUT] = 0 == PARSER.content_length ? |