Mercurial > hg > nginx
changeset 4138:70e1ee2307f9
Fix of separate pool for upstream connections (r4117).
Pool may not be created if connection was created but rejected in connect()
call. Make sure to check if it is here before trying to destroy it.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 20 Sep 2011 10:00:46 +0000 |
parents | 6b9b7e7ac4a9 |
children | 911060bc8221 |
files | src/http/ngx_http_upstream.c |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c Tue Sep 20 09:56:35 2011 +0000 +++ b/src/http/ngx_http_upstream.c Tue Sep 20 10:00:46 2011 +0000 @@ -2922,7 +2922,10 @@ } #endif - ngx_destroy_pool(u->peer.connection->pool); + if (u->peer.connection->pool) { + ngx_destroy_pool(u->peer.connection->pool); + } + ngx_close_connection(u->peer.connection); } @@ -3017,7 +3020,10 @@ "close http upstream connection: %d", u->peer.connection->fd); - ngx_destroy_pool(u->peer.connection->pool); + if (u->peer.connection->pool) { + ngx_destroy_pool(u->peer.connection->pool); + } + ngx_close_connection(u->peer.connection); }