From: des Date: Mon, 7 Aug 2006 16:11:29 +0000 (+0000) Subject: Check whether we have accept filters before trying to use them. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=704b489b474d76fca821556c98c228248b278163;p=varnish Check whether we have accept filters before trying to use them. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@728 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/tcp.c b/varnish-cache/bin/varnishd/tcp.c index 27b6b578..68bd8c0c 100644 --- a/varnish-cache/bin/varnishd/tcp.c +++ b/varnish-cache/bin/varnishd/tcp.c @@ -2,13 +2,14 @@ * $Id$ */ -#include -#include -#include -#include #include #include + +#include +#include #include +#include +#include #include "heritage.h" #include "mgt.h" @@ -46,6 +47,7 @@ TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen) /*--------------------------------------------------------------------*/ +#ifdef HAVE_ACCEPT_FILTERS static void accept_filter(int fd) { @@ -61,6 +63,7 @@ accept_filter(int fd) printf("Acceptfilter(%d, httpready): %d %s\n", fd, i, strerror(errno)); } +#endif static void create_listen_socket(const char *addr, const char *port, int *sp, int nsp) @@ -120,11 +123,15 @@ open_tcp(const char *port) for (u = 0; u < HERITAGE_NSOCKS; u++) { if (heritage.sock_local[u] >= 0) { AZ(listen(heritage.sock_local[u], 16)); +#ifdef HAVE_ACCEPT_FILTERS accept_filter(heritage.sock_local[u]); +#endif } if (heritage.sock_remote[u] >= 0) { AZ(listen(heritage.sock_remote[u], 16)); +#ifdef HAVE_ACCEPT_FILTERS accept_filter(heritage.sock_remote[u]); +#endif } } return (0); diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index 447b02b6..c9eed4d5 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -76,6 +76,11 @@ AC_CHECK_DECL([vasprintf], , [stdio.h]) +AC_CHECK_DECL([SO_ACCEPTFILER], + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept filters]), + , + [sys/types.h, sys/socket.h]) + AC_CONFIG_FILES([ Makefile bin/Makefile