From 07b64755b203d9c99a59ae69e3155103d4cfefc5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 May 2019 22:15:44 +0000 Subject: remove kgio from all read(2) and write(2) wrappers It's fairly easy given unicorn was designed with synchronous I/O in mind. The overhead of backtraces from EOFError on readpartial should be rare given our requirement to only accept requests from fast, reliable clients on LAN (e.g. nginx or yet-another-horribly-named-server). --- lib/unicorn/http_request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/unicorn/http_request.rb') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index bcc1f2d..69b9b52 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -75,11 +75,11 @@ class Unicorn::HttpParser e['REMOTE_ADDR'] = socket.kgio_addr # short circuit the common case with small GET requests first - socket.kgio_read!(16384, buf) + socket.readpartial(16384, buf) 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 - false until add_parse(socket.kgio_read!(16384)) + false until add_parse(socket.readpartial(16384)) end check_client_connection(socket) if @@check_client_connection -- cgit v1.2.3-24-ge0c7