diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-11-28 18:06:05 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-11-28 18:06:05 +0300 |
commit | fa62656b31620190390dd215b2ee1c12247e104a (patch) | |
tree | 56602f5b99ec479d2ea54ca2ac9587c5e48e0b9b | |
parent | a427e12619303f5156209462ab3b264facbb199c (diff) |
fix segfault
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index c33c2d4ba..69a12e0fc 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -637,8 +637,6 @@ ngx_http_proxy_create_request(ngx_http_request_t *r) plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); - len = sizeof(ngx_http_proxy_version) - 1 + sizeof(CRLF) - 1; - if (u->method.len) { /* HEAD was changed to GET to cache response */ method = u->method; @@ -652,6 +650,8 @@ ngx_http_proxy_create_request(ngx_http_request_t *r) method.len++; } + len = method.len + sizeof(ngx_http_proxy_version) - 1 + sizeof(CRLF) - 1; + escape = 0; loc_len = 0; unparsed_uri = 0; @@ -659,12 +659,12 @@ ngx_http_proxy_create_request(ngx_http_request_t *r) ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module); if (plcf->proxy_lengths) { - len += method.len + ctx->vars.uri.len; + len += ctx->vars.uri.len; } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main) { unparsed_uri = 1; - len += method.len + r->unparsed_uri.len; + len += r->unparsed_uri.len; } else { loc_len = (r->valid_location && ctx->vars.uri.len) ? |