From aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 6 Sep 2004 18:45:00 +0000 Subject: nginx-0.0.10-2004-09-06-22:45:00 import --- src/http/modules/proxy/ngx_http_proxy_header.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/http/modules/proxy/ngx_http_proxy_header.c') diff --git a/src/http/modules/proxy/ngx_http_proxy_header.c b/src/http/modules/proxy/ngx_http_proxy_header.c index a3e05e513..9e72f629b 100644 --- a/src/http/modules/proxy/ngx_http_proxy_header.c +++ b/src/http/modules/proxy/ngx_http_proxy_header.c @@ -12,13 +12,31 @@ int ngx_http_proxy_copy_header(ngx_http_proxy_ctx_t *p, ngx_http_proxy_headers_in_t *headers_in) { ngx_uint_t i; + ngx_list_part_t *part; ngx_table_elt_t *ho, *h; ngx_http_request_t *r; r = p->request; + part = &headers_in->headers.part; + h = part->elts; + +#if 0 h = headers_in->headers.elts; for (i = 0; i < headers_in->headers.nelts; i++) { +#endif + + for (i = 0 ; /* void */; i++) { + + if (i >= part->nelts) { + if (part->next == NULL) { + break; + } + + part = part->next; + h = part->elts; + i = 0; + } /* ignore some headers */ @@ -69,8 +87,7 @@ int ngx_http_proxy_copy_header(ngx_http_proxy_ctx_t *p, /* copy some header pointers and set up r->headers_out */ - if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) - { + if (!(ho = ngx_list_push(&r->headers_out.headers))) { return NGX_ERROR; } @@ -138,8 +155,7 @@ static int ngx_http_proxy_rewrite_location_header(ngx_http_proxy_ctx_t *p, r = p->request; uc = p->lcf->upstream; - location = ngx_http_add_header(&r->headers_out, ngx_http_headers_out); - if (location == NULL) { + if (!(location = ngx_list_push(&r->headers_out.headers))) { return NGX_ERROR; } -- cgit v1.2.3