Commit 477ca698 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r4171: Implement the linux equivalent of BSD accept filter using TCP_DEFER_ACCEPT



git-svn-id: http://www.varnish-cache.org/svn/branches/2.0@4298 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 12401f41
......@@ -36,6 +36,10 @@
#include <netinet/in.h>
#ifdef __linux
#include <netinet/tcp.h>
#endif
#include <errno.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
......@@ -113,6 +117,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