Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 4] Fix of separate pool for upstream connectins

Maxim Dounin
September 19, 2011 03:02AM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1316368092 -14400
# Node ID 187de3097048531a3bd3d7a84a40657d1f0df216
# Parent 61039cdc036dce3956ef8fe91852bab795492222
Fix of separate pool for upstream connectins.

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.

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2922,7 +2922,10 @@ ngx_http_upstream_next(ngx_http_request_
}
#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 @@ ngx_http_upstream_finalize_request(ngx_h
"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);
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 1 of 4] Fix of separate pool for upstream connectins

Maxim Dounin 1338 September 19, 2011 03:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 283
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready