Klaus Demo nginx / ec8186c
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
4 changed file(s) with 24 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
294294 fi
295295 fi
296296
297
297298 ngx_feature="SO_SETFIB"
298299 ngx_feature_name="NGX_HAVE_SETFIB"
299300 ngx_feature_run=no
301302 ngx_feature_path=
302303 ngx_feature_libs=
303304 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)"
304327 . auto/feature
305328
306329
579579 {
580580 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
581581 "setsockopt(SO_ACCEPTFILTER, \"%s\") "
582 " for %V failed, ignored",
582 "for %V failed, ignored",
583583 ls[i].accept_filter, &ls[i].addr_text);
584584 continue;
585585 }
9191 #define NGX_LISTEN_BACKLOG -1
9292
9393
94 #if (defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT)
95 #define NGX_HAVE_DEFERRED_ACCEPT 1
96 #endif
97
98
9994 #if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)
10095
10196 pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);
9595 #define NGX_LISTEN_BACKLOG 511
9696
9797
98 #if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
99 #define NGX_HAVE_DEFERRED_ACCEPT 1
100 #endif
101
102
10398 #ifndef NGX_HAVE_SO_SNDLOWAT
10499 /* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
105100 #define NGX_HAVE_SO_SNDLOWAT 0