Mercurial > hg > nginx-quic
diff src/http/modules/ngx_http_proxy_module.c @ 3245:61962127b166 stable-0.7
merge r3001, r3007, r3013:
fix variuos segfaults:
*) fix segfault if 400 or 414 errors are handled intricately
*) ngx_http_upstream_create() to cleanup the previous upstream after
internal redirect
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 26 Oct 2009 17:09:27 +0000 |
parents | 2efa8d2fcde1 |
children | 0189a8f4c7c3 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -590,13 +590,10 @@ ngx_http_proxy_handler(ngx_http_request_ ngx_http_proxy_ctx_t *ctx; ngx_http_proxy_loc_conf_t *plcf; - u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); - if (u == NULL) { + if (ngx_http_upstream_create(r) != NGX_OK) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } - r->upstream = u; - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_proxy_ctx_t)); if (ctx == NULL) { return NGX_ERROR; @@ -606,6 +603,8 @@ ngx_http_proxy_handler(ngx_http_request_ plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); + u = r->upstream; + if (plcf->proxy_lengths == 0) { ctx->vars = plcf->vars; u->schema = plcf->vars.schema; @@ -619,12 +618,6 @@ ngx_http_proxy_handler(ngx_http_request_ } } - u->peer.log = r->connection->log; - u->peer.log_error = NGX_ERROR_ERR; -#if (NGX_THREADS) - u->peer.lock = &r->connection->lock; -#endif - u->output.tag = (ngx_buf_tag_t) &ngx_http_proxy_module; u->conf = &plcf->upstream;