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).
Maxim Dounin
10 years ago
294 | 294 |
fi
|
295 | 295 |
fi
|
296 | 296 |
|
|
297 |
|
297 | 298 |
ngx_feature="SO_SETFIB"
|
298 | 299 |
ngx_feature_name="NGX_HAVE_SETFIB"
|
299 | 300 |
ngx_feature_run=no
|
|
301 | 302 |
ngx_feature_path=
|
302 | 303 |
ngx_feature_libs=
|
303 | 304 |
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
|
|
305 |
. auto/feature
|
|
306 |
|
|
307 |
|
|
308 |
ngx_feature="SO_ACCEPTFILTER"
|
|
309 |
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
310 |
ngx_feature_run=no
|
|
311 |
ngx_feature_incs="#include <sys/socket.h>"
|
|
312 |
ngx_feature_path=
|
|
313 |
ngx_feature_libs=
|
|
314 |
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
|
|
315 |
. auto/feature
|
|
316 |
|
|
317 |
|
|
318 |
ngx_feature="TCP_DEFER_ACCEPT"
|
|
319 |
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
320 |
ngx_feature_run=no
|
|
321 |
ngx_feature_incs="#include <sys/socket.h>
|
|
322 |
#include <netinet/in.h>
|
|
323 |
#include <netinet/tcp.h>"
|
|
324 |
ngx_feature_path=
|
|
325 |
ngx_feature_libs=
|
|
326 |
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
|
304 | 327 |
. auto/feature
|
305 | 328 |
|
306 | 329 |
|
579 | 579 |
{
|
580 | 580 |
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
|
581 | 581 |
"setsockopt(SO_ACCEPTFILTER, \"%s\") "
|
582 | |
" for %V failed, ignored",
|
|
582 |
"for %V failed, ignored",
|
583 | 583 |
ls[i].accept_filter, &ls[i].addr_text);
|
584 | 584 |
continue;
|
585 | 585 |
}
|
91 | 91 |
#define NGX_LISTEN_BACKLOG -1
|
92 | 92 |
|
93 | 93 |
|
94 | |
#if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
|
95 | |
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
96 | |
#endif
|
97 | |
|
98 | |
|
99 | 94 |
#if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)
|
100 | 95 |
|
101 | 96 |
pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);
|
95 | 95 |
#define NGX_LISTEN_BACKLOG 511
|
96 | 96 |
|
97 | 97 |
|
98 | |
#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
|
99 | |
#define NGX_HAVE_DEFERRED_ACCEPT 1
|
100 | |
#endif
|
101 | |
|
102 | |
|
103 | 98 |
#ifndef NGX_HAVE_SO_SNDLOWAT
|
104 | 99 |
/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
|
105 | 100 |
#define NGX_HAVE_SO_SNDLOWAT 0
|