From 0838ce19502ab63fc9cd582ddc77904f2590b99c Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Wed, 30 Sep 2020 17:21:08 +0300 Subject: [PATCH] fix infinite loop ngx_http_upsync_del_delay_delete(): conn_interval shouldn't be zero. When ngx_cycle->connection_n < 30, we have to explicitly set it to 1. --- src/ngx_http_upsync_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ngx_http_upsync_module.c b/src/ngx_http_upsync_module.c index b87a2f4..1d3cc6f 100644 --- a/src/ngx_http_upsync_module.c +++ b/src/ngx_http_upsync_module.c @@ -3286,6 +3286,9 @@ ngx_http_upsync_del_delay_delete(ngx_event_t *event) c = ngx_cycle->connections; conn_interval = ngx_cycle->connection_n / 30; + if (!conn_interval) { + conn_interval = 1; + } for (i = 0; i < ngx_cycle->connection_n; i += conn_interval) { if (c[i].fd == (ngx_socket_t) -1) {