about summary refs log tree commit homepage
path: root/lib/unicorn/http_request.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-04 17:04:51 -0700
committerEric Wong <normalperson@yhbt.net>2011-05-04 17:04:51 -0700
commit1b0ee5826ef146a3e2647c40f3bc929d51d1b442 (patch)
tree24cc8da08ddba2cada51afdf8bc91964c4ca4c39 /lib/unicorn/http_request.rb
parentf81aa02448b615c4d5fc4f6544c53289dae9d2ec (diff)
downloadunicorn-1b0ee5826ef146a3e2647c40f3bc929d51d1b442.tar.gz
Combines the following sequence:

   http_parser.buf << socket.readpartial(0x4000)
   http_parser.parse

Into:

   http_parser.add_parse(socket.readpartial(0x4000))

It was too damn redundant otherwise...
Diffstat (limited to 'lib/unicorn/http_request.rb')
-rw-r--r--lib/unicorn/http_request.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb
index e72f571..a0435d6 100644
--- a/lib/unicorn/http_request.rb
+++ b/lib/unicorn/http_request.rb
@@ -68,9 +68,7 @@ class Unicorn::HttpParser
     if parse.nil?
       # 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.kgio_read!(16384)
-      end while parse.nil?
+      false until add_parse(socket.kgio_read!(16384))
     end
     e[RACK_INPUT] = 0 == content_length ?
                     NULL_IO : @@input_class.new(socket, self)