Move SO_ACCEPTFILTER and TCP_DEFER_ACCEPT checks into configure.

NetBSD 5.0+ has SO_ACCEPTFILTER support merged from FreeBSD, and having
accept filter check in FreeBSD-specific ngx_freebsd_config.h prevents it
from being used on NetBSD.  Therefore move the check into configure (and
do the same for Linux-specific TCP_DEFER_ACCEPT, just to be in line).
This commit is contained in:
Maxim Dounin 2011-08-21 11:37:37 +00:00
parent 5a52d67a08
commit ec8186c733
4 changed files with 24 additions and 11 deletions

View file

@ -580,7 +580,7 @@ ngx_configure_listening_sockets(ngx_cycle_t *cycle)
{
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"setsockopt(SO_ACCEPTFILTER, \"%s\") "
" for %V failed, ignored",
"for %V failed, ignored",
ls[i].accept_filter, &ls[i].addr_text);
continue;
}

View file

@ -92,11 +92,6 @@ typedef struct aiocb ngx_aiocb_t;
#define NGX_LISTEN_BACKLOG -1
#if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
#if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)
pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);

View file

@ -96,11 +96,6 @@ typedef struct iocb ngx_aiocb_t;
#define NGX_LISTEN_BACKLOG 511
#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
#ifndef NGX_HAVE_SO_SNDLOWAT
/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
#define NGX_HAVE_SO_SNDLOWAT 0