about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-03 15:19:00 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-03 15:19:00 -0700
commitc88dafaa616ddd0741f929f5c5988e0c8769b15f (patch)
tree18a0d3657ab09612148508fb4f109c2f666368d5
parenta5c51c33862580674c997be91dc705c2cf000a36 (diff)
downloadunicorn-c88dafaa616ddd0741f929f5c5988e0c8769b15f.tar.gz
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.
-rw-r--r--lib/unicorn.rb2
1 files changed, 0 insertions, 2 deletions
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