From 28b001f897e3d3dfdffe1cca811657dd36961605 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Sun, 25 Sep 2011 20:00:36 +0000 Subject: [PATCH] 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index ef16a662c..3d022c78f 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -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