Commit f87d0f05 authored by Artur Bergman's avatar Artur Bergman

Implement the linux equivalent of BSD accept filter using TCP_DEFER_ACCEPT

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4171 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 535cc8e0
......@@ -37,6 +37,10 @@ SVNID("$Id$")
#include <netinet/in.h>
#ifdef __linux
#include <netinet/tcp.h>
#endif
#include <errno.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
......@@ -114,6 +118,10 @@ TCP_filter_http(int sock)
printf("Acceptfilter(%d, httpready): %d %s\n",
sock, i, strerror(errno));
return (i);
#elif defined(__linux)
int defer = 1;
setsockopt(sock, SOL_TCP,TCP_DEFER_ACCEPT,(char *) &defer, sizeof(int));
return (0);
#else
(void)sock;
return (0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment