]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4144:
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 13 Dec 2011 18:30:15 +0000 (18:30 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 13 Dec 2011 18:30:15 +0000 (18:30 +0000)
Upstream: clearing of u->peer.connection on close.

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 5aa96a4258ce98e0137258620f226a509b3d68d7..7fba19faf0b49a908d0bf748dad929f4ba6abce6 100644 (file)
@@ -2888,6 +2888,7 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
 #endif
 
         ngx_close_connection(u->peer.connection);
+        u->peer.connection = NULL;
     }
 
 #if 0