fix segfault
Igor Sysoev
14 years ago
636 | 636 | |
637 | 637 | plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); |
638 | 638 | |
639 | len = sizeof(ngx_http_proxy_version) - 1 + sizeof(CRLF) - 1; | |
640 | ||
641 | 639 | if (u->method.len) { |
642 | 640 | /* HEAD was changed to GET to cache response */ |
643 | 641 | method = u->method; |
651 | 649 | method.len++; |
652 | 650 | } |
653 | 651 | |
652 | len = method.len + sizeof(ngx_http_proxy_version) - 1 + sizeof(CRLF) - 1; | |
653 | ||
654 | 654 | escape = 0; |
655 | 655 | loc_len = 0; |
656 | 656 | unparsed_uri = 0; |
658 | 658 | ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module); |
659 | 659 | |
660 | 660 | if (plcf->proxy_lengths) { |
661 | len += method.len + ctx->vars.uri.len; | |
661 | len += ctx->vars.uri.len; | |
662 | 662 | |
663 | 663 | } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main) |
664 | 664 | { |
665 | 665 | unparsed_uri = 1; |
666 | len += method.len + r->unparsed_uri.len; | |
666 | len += r->unparsed_uri.len; | |
667 | 667 | |
668 | 668 | } else { |
669 | 669 | loc_len = (r->valid_location && ctx->vars.uri.len) ? |