about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-15 12:34:18 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-15 12:37:05 -0800
commite2f68e87cdccc872a680a5ce7e4368361ee3bfec (patch)
tree54086321c07ba7b847103e7313e70e9d0370471e
parent177db62ef7566e129a52a3ee1afcd4bfb6073452 (diff)
downloadunicorn-e2f68e87cdccc872a680a5ce7e4368361ee3bfec.tar.gz
-rw-r--r--lib/unicorn/socket_helper.rb9
1 files changed, 8 insertions, 1 deletions
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