From c88dafaa616ddd0741f929f5c5988e0c8769b15f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 3 May 2009 15:19:00 -0700 Subject: No point in unsetting the O_NONBLOCK flag Since we've switched to readpartial, we'll already be protected from any unpleasant errors that might get thrown at us. There's no easy way to prevent MRI from calling a select() internally to check for readiness, so speculative+blocking read() calls are out already. Additionally, most requests come in the form of GETs which are fully-buffered in the kernel before we even accept() the socket; so a single readpartial call will be enough to fully consume it. --- lib/unicorn.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 71d2c45..f753ea2 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -414,8 +414,6 @@ module Unicorn # once a client is accepted, it is processed in its entirety here # in 3 easy steps: read request, call app, write app response def process_client(client) - # one syscall less than "client.nonblock = false": - client.fcntl(Fcntl::F_SETFL, File::RDWR) HttpResponse.write(client, @app.call(@request.read(client))) # if we get any error, try to write something back to the client # assuming we haven't closed the socket, but don't get hung up -- cgit v1.2.3-24-ge0c7