# HG changeset patch # User Maxim Dounin # Date 1314229425 -14400 # Node ID ac0a7fd4de491e64d42f218691b681f7b3fa931b # Parent e865cb2cc06a88c01a439bfdd0d0d7dec54713f0 Upstream: create separate pool for peer connections. This is required to support persistant https connections as various ssl structures are allocated from connection's pool. 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 @@ -1146,8 +1146,17 @@ ngx_http_upstream_connect(ngx_http_reque c->sendfile &= r->connection->sendfile; u->output.sendfile = c->sendfile; - c->pool = r->pool; + if (c->pool == NULL) { + c->pool = ngx_create_pool(128, r->connection->log); + if (c->pool == NULL) { + ngx_http_upstream_finalize_request(r, u, + NGX_HTTP_INTERNAL_SERVER_ERROR); + return; + } + } + c->log = r->connection->log; + c->pool->log = c->log; c->read->log = c->log; c->write->log = c->log; @@ -2912,6 +2921,7 @@ ngx_http_upstream_next(ngx_http_request_ } #endif + ngx_destroy_pool(u->peer.connection->pool); ngx_close_connection(u->peer.connection); } @@ -3006,6 +3016,7 @@ ngx_http_upstream_finalize_request(ngx_h "close http upstream connection: %d", u->peer.connection->fd); + ngx_destroy_pool(u->peer.connection->pool); ngx_close_connection(u->peer.connection); }