From 27bf274dbb928d1afcc8328423d9ec74d0a7b250 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 8 Aug 2022 22:41:34 -0700 Subject: [PATCH] Modules: fixed socket leak with 0 fetch timeout. --- nginx/ngx_js_fetch.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nginx/ngx_js_fetch.c b/nginx/ngx_js_fetch.c index 3fb79285..97de9167 100644 --- a/nginx/ngx_js_fetch.c +++ b/nginx/ngx_js_fetch.c @@ -907,10 +907,8 @@ ngx_js_http_connect(ngx_js_http_t *http) http->process = ngx_js_http_process_status_line; - if (http->timeout) { - ngx_add_timer(http->peer.connection->read, http->timeout); - ngx_add_timer(http->peer.connection->write, http->timeout); - } + ngx_add_timer(http->peer.connection->read, http->timeout); + ngx_add_timer(http->peer.connection->write, http->timeout); #if (NGX_SSL) if (http->ssl != NULL && http->peer.connection->ssl == NULL) { @@ -1175,7 +1173,7 @@ ngx_js_http_write_handler(ngx_event_t *wev) } } - if (!wev->timer_set && http->timeout) { + if (!wev->timer_set) { ngx_add_timer(wev, http->timeout); } } -- 2.47.3