From d4c898a4adc6cb6c3a20a648ae6b9b6a226066a6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 5 Oct 2010 23:34:39 +0000 Subject: upgrade to kgio 1.2.0 This provides the kgio_read! method which is like readpartial, only significantly cheaper when a client disconnects on us. --- lib/unicorn/http_request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 7519170..13e9900 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -64,11 +64,11 @@ class Unicorn::HttpRequest @env[REMOTE_ADDR] = socket.kgio_addr # short circuit the common case with small GET requests first - if @parser.headers(@env, socket.readpartial(16384, @buf)).nil? + if @parser.headers(@env, socket.kgio_read!(16384, @buf)).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.readpartial(16384) + @buf << socket.kgio_read!(16384) end while @parser.headers(@env, @buf).nil? end @env[RACK_INPUT] = 0 == @parser.content_length ? -- cgit v1.2.3-24-ge0c7