From: Volker Lendecke Date: Thu, 15 Dec 2011 15:12:37 +0000 (+0100) Subject: Add support for TCP_DEFER_ACCEPT X-Git-Url: http://git.samba.org/?p=kai%2Fsamba.git;a=commitdiff_plain;h=bcd3db6264fbe4d2e71c0844a46b885e3c542e2a Add support for TCP_DEFER_ACCEPT "man tcp" on Linux says: TCP_DEFER_ACCEPT Allows a listener to be awakened only when data arrives on the socket. Takes an integer value (seconds), this can bound the maximum number of attempts TCP will make to complete the connection. This option should not be used in code intended to be portable. This might reduce the 139/445 forks a bit on high-load servers --- diff --git a/lib/util/util_net.c b/lib/util/util_net.c index 1f6ecdd87ba..637c52b9884 100644 --- a/lib/util/util_net.c +++ b/lib/util/util_net.c @@ -811,6 +811,9 @@ static const smb_socket_option socket_options[] = { #endif #ifdef TCP_KEEPALIVE_ABORT_THRESHOLD {"TCP_KEEPALIVE_ABORT_THRESHOLD", IPPROTO_TCP, TCP_KEEPALIVE_ABORT_THRESHOLD, 0, OPT_INT}, +#endif +#ifdef TCP_DEFER_ACCEPT + {"TCP_DEFER_ACCEPT", IPPROTO_TCP, TCP_DEFER_ACCEPT, 0, OPT_INT}, #endif {NULL,0,0,0,0}};