]> git.kaiwu.me - njs.git/commitdiff
Modules: fixed socket leak with 0 fetch timeout.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 9 Aug 2022 05:41:34 +0000 (22:41 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 9 Aug 2022 05:41:34 +0000 (22:41 -0700)
nginx/ngx_js_fetch.c

index 3fb79285a33532eb11d8cc9b392ebfee3cc94760..97de91677e3f9e53fb88b609370b626a079a3dd4 100644 (file)
@@ -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);
     }
 }