From e2f68e87cdccc872a680a5ce7e4368361ee3bfec Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 15 Nov 2009 12:34:18 -0800 Subject: socket_helper: RDoc for constants --- lib/unicorn/socket_helper.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb index 886d0f3..09085e5 100644 --- a/lib/unicorn/socket_helper.rb +++ b/lib/unicorn/socket_helper.rb @@ -11,16 +11,23 @@ module Unicorn when /linux/ # from /usr/include/linux/tcp.h TCP_DEFER_ACCEPT = 9 unless defined?(TCP_DEFER_ACCEPT) + + # do not send out partial frames (Linux) TCP_CORK = 3 unless defined?(TCP_CORK) when /freebsd(([1-4]\..{1,2})|5\.[0-4])/ # Do nothing for httpready, just closing a bug when freebsd <= 5.4 - TCP_NOPUSH = 4 unless defined?(TCP_NOPUSH) + TCP_NOPUSH = 4 unless defined?(TCP_NOPUSH) # :nodoc: when /freebsd/ + # do not send out partial frames (FreeBSD) TCP_NOPUSH = 4 unless defined?(TCP_NOPUSH) + # Use the HTTP accept filter if available. # The struct made by pack() is defined in /usr/include/sys/socket.h # as accept_filter_arg unless `/sbin/sysctl -nq net.inet.accf.http`.empty? + # set set the "httpready" accept filter in FreeBSD if available + # if other protocols are to be supported, this may be + # String#replace-d with "dataready" arguments instead FILTER_ARG = ['httpready', nil].pack('a16a240') end end -- cgit v1.2.3-24-ge0c7