Mercurial > hg > nginx-quic
comparison src/event/ngx_event.c @ 8975:09463dd9c504
Disabled cloning of sockets without master process (ticket #2403).
Cloning of listening sockets for each worker process does not make sense
when working without master process, and causes some of the connections
not to be accepted if worker_processes is set to more than one and there
are listening sockets configured with the reuseport flag. Fix is to
disable cloning when master process is disabled.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 23 Nov 2022 23:12:04 +0300 |
parents | e2d07e4ec636 |
children | 8852f39311de |
comparison
equal
deleted
inserted
replaced
8974:4cc2bfeff46c | 8975:09463dd9c504 |
---|---|
414 static char * | 414 static char * |
415 ngx_event_init_conf(ngx_cycle_t *cycle, void *conf) | 415 ngx_event_init_conf(ngx_cycle_t *cycle, void *conf) |
416 { | 416 { |
417 #if (NGX_HAVE_REUSEPORT) | 417 #if (NGX_HAVE_REUSEPORT) |
418 ngx_uint_t i; | 418 ngx_uint_t i; |
419 ngx_core_conf_t *ccf; | |
419 ngx_listening_t *ls; | 420 ngx_listening_t *ls; |
420 #endif | 421 #endif |
421 | 422 |
422 if (ngx_get_conf(cycle->conf_ctx, ngx_events_module) == NULL) { | 423 if (ngx_get_conf(cycle->conf_ctx, ngx_events_module) == NULL) { |
423 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, | 424 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, |
440 return NGX_CONF_ERROR; | 441 return NGX_CONF_ERROR; |
441 } | 442 } |
442 | 443 |
443 #if (NGX_HAVE_REUSEPORT) | 444 #if (NGX_HAVE_REUSEPORT) |
444 | 445 |
445 if (!ngx_test_config) { | 446 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); |
447 | |
448 if (!ngx_test_config && ccf->master) { | |
446 | 449 |
447 ls = cycle->listening.elts; | 450 ls = cycle->listening.elts; |
448 for (i = 0; i < cycle->listening.nelts; i++) { | 451 for (i = 0; i < cycle->listening.nelts; i++) { |
449 | 452 |
450 if (!ls[i].reuseport || ls[i].worker != 0) { | 453 if (!ls[i].reuseport || ls[i].worker != 0) { |