comparison src/http/ngx_http_upstream.c @ 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 0c30976f5bfa
children 114e3a7c3b8d
comparison
equal deleted inserted replaced
4137:6b9b7e7ac4a9 4138:70e1ee2307f9
2920 2920
2921 (void) ngx_ssl_shutdown(u->peer.connection); 2921 (void) ngx_ssl_shutdown(u->peer.connection);
2922 } 2922 }
2923 #endif 2923 #endif
2924 2924
2925 ngx_destroy_pool(u->peer.connection->pool); 2925 if (u->peer.connection->pool) {
2926 ngx_destroy_pool(u->peer.connection->pool);
2927 }
2928
2926 ngx_close_connection(u->peer.connection); 2929 ngx_close_connection(u->peer.connection);
2927 } 2930 }
2928 2931
2929 #if 0 2932 #if 0
2930 if (u->conf->busy_lock && !u->busy_locked) { 2933 if (u->conf->busy_lock && !u->busy_locked) {
3015 3018
3016 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 3019 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
3017 "close http upstream connection: %d", 3020 "close http upstream connection: %d",
3018 u->peer.connection->fd); 3021 u->peer.connection->fd);
3019 3022
3020 ngx_destroy_pool(u->peer.connection->pool); 3023 if (u->peer.connection->pool) {
3024 ngx_destroy_pool(u->peer.connection->pool);
3025 }
3026
3021 ngx_close_connection(u->peer.connection); 3027 ngx_close_connection(u->peer.connection);
3022 } 3028 }
3023 3029
3024 u->peer.connection = NULL; 3030 u->peer.connection = NULL;
3025 3031