diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-16 16:07:16 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-16 16:09:31 -0700 |
commit | 045f6d741020d4a77bd68bd80891a97782d54850 (patch) | |
tree | 8f804cc4e522c0a066b4aaa97ccca81f9a8388a1 | |
parent | ac4537afc4eddfb68bc7807f7a6140afb7160328 (diff) | |
download | unicorn-045f6d741020d4a77bd68bd80891a97782d54850.tar.gz |
We may add support for the Gopher protocol in the future...
-rw-r--r-- | lib/unicorn/socket_helper.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb index 18caf69..e287955 100644 --- a/lib/unicorn/socket_helper.rb +++ b/lib/unicorn/socket_helper.rb @@ -20,10 +20,8 @@ module Unicorn # Use the HTTP accept filter if available. # The struct made by pack() is defined in /usr/include/sys/socket.h # as accept_filter_arg - # We won't be seupportin the "dataready" filter unlike nginx - # since we only support HTTP and no other protocols unless `/sbin/sysctl -nq net.inet.accf.http`.empty? - HTTPREADY = ['httpready', nil].pack('a16a240').freeze + FILTER_ARG = ['httpready', nil].pack('a16a240') end end @@ -46,8 +44,8 @@ module Unicorn # No good reason to ever have deferred accepts off if defined?(TCP_DEFER_ACCEPT) sock.setsockopt(SOL_TCP, TCP_DEFER_ACCEPT, 1) rescue nil - elsif defined?(SO_ACCEPTFILTER) && defined?(HTTPREADY) - sock.setsockopt(SOL_SOCKET, SO_ACCEPTFILTER, HTTPREADY) rescue nil + elsif defined?(SO_ACCEPTFILTER) && defined?(FILTER_ARG) + sock.setsockopt(SOL_SOCKET, SO_ACCEPTFILTER, FILTER_ARG) rescue nil end end |