From: Dmitry Volyntsev Date: Tue, 9 Aug 2022 05:41:34 +0000 (-0700) Subject: Modules: fixed socket leak with 0 fetch timeout. X-Git-Tag: 0.7.7~16 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=27bf274dbb928d1afcc8328423d9ec74d0a7b250;p=njs.git Modules: fixed socket leak with 0 fetch timeout. --- 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); } }