]> git.kaiwu.me - nginx.git/commitdiff
Upstream: clearing of u->peer.connection on close.
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 25 Sep 2011 20:00:36 +0000 (20:00 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 25 Sep 2011 20:00:36 +0000 (20:00 +0000)
This fixes crashes observed with some 3rd party balancer modules.  Standard
balancer modules (round-robin and ip hash) explicitly set pc->connection
(aka u->peer.connection) to NULL and aren't affected.

src/http/ngx_http_upstream.c

index ef16a662c7c5bc584d7b825aa69448f609858bca..3d022c78fe60644959942ec28c8bfb9b0a68adb7 100644 (file)
@@ -2927,6 +2927,7 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
         }
 
         ngx_close_connection(u->peer.connection);
+        u->peer.connection = NULL;
     }
 
 #if 0