mirror of
https://github.com/nginx/nginx.git
synced 2025-01-19 01:42:58 +08:00
Fixed range checking for the "somaxconn" sysctl.
This commit is contained in:
parent
620718102b
commit
c5762451a9
@ -88,7 +88,6 @@ ngx_debug_init()
|
||||
ngx_int_t
|
||||
ngx_os_specific_init(ngx_log_t *log)
|
||||
{
|
||||
int somaxconn;
|
||||
size_t size;
|
||||
ngx_err_t err;
|
||||
ngx_uint_t i;
|
||||
@ -155,12 +154,9 @@ ngx_os_specific_init(ngx_log_t *log)
|
||||
|
||||
ngx_ncpu = ngx_darwin_hw_ncpu;
|
||||
|
||||
somaxconn = 32676;
|
||||
|
||||
if (ngx_darwin_kern_ipc_somaxconn > somaxconn) {
|
||||
if (ngx_darwin_kern_ipc_somaxconn > 32767) {
|
||||
ngx_log_error(NGX_LOG_ALERT, log, 0,
|
||||
"sysctl kern.ipc.somaxconn must be no more than %d",
|
||||
somaxconn);
|
||||
"sysctl kern.ipc.somaxconn must be less than 32768");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ ngx_debug_init()
|
||||
ngx_int_t
|
||||
ngx_os_specific_init(ngx_log_t *log)
|
||||
{
|
||||
int version, somaxconn;
|
||||
int version;
|
||||
size_t size;
|
||||
ngx_err_t err;
|
||||
ngx_uint_t i;
|
||||
@ -210,12 +210,9 @@ ngx_os_specific_init(ngx_log_t *log)
|
||||
ngx_ncpu = ngx_freebsd_hw_ncpu;
|
||||
}
|
||||
|
||||
somaxconn = version < 600008 ? 32676 : 65535;
|
||||
|
||||
if (ngx_freebsd_kern_ipc_somaxconn > somaxconn) {
|
||||
if (version < 600008 && ngx_freebsd_kern_ipc_somaxconn > 32767) {
|
||||
ngx_log_error(NGX_LOG_ALERT, log, 0,
|
||||
"sysctl kern.ipc.somaxconn must be no more than %d",
|
||||
somaxconn);
|
||||
"sysctl kern.ipc.somaxconn must be less than 32768");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user