<div dir="ltr"># HG changeset patch<br># User Chenglong Zhang <<a href="mailto:dongbeiouba@gmail.com">dongbeiouba@gmail.com</a>><br># Date 1609232548 -28800<br>#      Tue Dec 29 17:02:28 2020 +0800<br># Node ID 65bb4c9c296d2c424286e2b36db96a4ba768369e<br># Parent  82228f955153527fba12211f52bf102c90f38dfb<br>Clear connection pointer just after close it.<br><br>        ngx_close_connection(u->peer.connection);<br>        u->peer.connection = NULL;<br><br>diff -r 82228f955153 -r 65bb4c9c296d src/http/ngx_http_upstream.c<br>--- a/src/http/ngx_http_upstream.c  Tue Dec 15 17:41:39 2020 +0300<br>+++ b/src/http/ngx_http_upstream.c      Tue Dec 29 17:02:28 2020 +0800<br>@@ -4402,9 +4402,8 @@<br>         }<br><br>         ngx_close_connection(u->peer.connection);<br>-    }<br>-<br>-    u->peer.connection = NULL;<br>+        u->peer.connection = NULL;<br>+    }<br><br>     if (u->pipe && u->pipe->temp_file) {<br>         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,<br></div>