diff options
author | Daniel Vassdal <shutter@canternet.org> | 2013-05-22 12:48:58 -0700 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-06-03 18:45:46 +0200 |
commit | 263c2efd960057f1cfafd40fce338605c39b0ad4 (patch) | |
tree | bd953e551f1f184b3725da2cf9656a4bb302983b /configure | |
parent | ca4c4a67988419b9eb479ffcf82238dc1648b0ad (diff) |
Added option for using TCP_DEFER_ACCEPT. Prevents the connection from being handed over to the daemon before data is ready from the client.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -346,6 +346,18 @@ if (test_file($config{CC}, "eventfd.cpp")) { print "no\n"; } +printf "Checking if a TCP deferring mechanism is available... "; +if (test_file($config{CC}, "tcp_defer_accept.cpp")) { + $config{HAS_DEFER} = "TCP_DEFER_ACCEPT"; + print "yes (TCP_DEFER_ACCEPT)\n"; +} elsif (test_file($config{CC}, "so_acceptfilter.cpp")) { + $config{HAS_DEFER} = "SO_ACCEPTFILTER"; + print "yes (SO_ACCEPTFILTER)\n"; +} else { + $config{HAS_DEFER} = "false"; + print "no\n"; +} + print "Checking whether epoll is available... "; $has_epoll = test_header($config{CC}, "sys/epoll.h"); print $has_epoll ? "yes\n" : "no\n"; @@ -875,6 +887,13 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; $config{SOCKETENGINE} = "socketengine_select"; } } + + if ($config{HAS_DEFER} eq "TCP_DEFER_ACCEPT") { + print FILEHANDLE "#define USE_TCP_DEFER_ACCEPT"; + } elsif ($config{HAS_DEFER} eq "SO_ACCEPTFILTER") { + print FILEHANDLE "#define USE_SO_ACCEPTFILTER" + } + print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n"; close(FILEHANDLE); |