Re-add support for non-portable socket options
commitf63f79f24ea3c6419b2664cbda5f2cbb41225bbe
authorEric Wong <normalperson@yhbt.net>
Wed, 1 Jul 2009 02:16:43 +0000 (30 19:16 -0700)
committerEric Wong <normalperson@yhbt.net>
Wed, 8 Jul 2009 21:49:52 +0000 (8 14:49 -0700)
tree6cb7ec609a27dfbdaed1b527603b9fe13422f923
parent98e77adbdcdd96d24c98fd098d9a046f152d6535
Re-add support for non-portable socket options

Now that we support tunnelling arbitrary protocols over HTTP as
well as "100 Continue" responses, TCP_NODELAY actually becomes
useful to us.  TCP_NODELAY is actually reasonably portable
nowadays; even.

While we're adding non-portable options, TCP_CORK/TCP_NOPUSH can
be enabled, too.  Unlike some other servers, these can't be
disabled explicitly/intelligently to force a flush, however.
However, these may still improve performance with "normal" HTTP
applications (Mongrel has always had TCP_CORK enabled in Linux).

While we're adding OS-specific features, we might as well
support TCP_DEFER_ACCEPT in Linux and FreeBSD the "httpready"
accept filter to prevent abuse.

These options can all be enabled on a per-listener basis.
(cherry picked from commit 563d03f649ef31d2aec3505cbbed1e015493b8fc)
lib/unicorn/configurator.rb
lib/unicorn/socket_helper.rb