mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 11:52:00 +00:00
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.
This commit is contained in:
parent
265e51aa0b
commit
afe2e3d082
1 changed files with 8 additions and 2 deletions
|
|
@ -2922,7 +2922,10 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||
}
|
||||
#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_http_request_t *r,
|
|||
"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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue