aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/proxy/ngx_http_proxy_header.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-09-06 18:45:00 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-09-06 18:45:00 +0000
commitaab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a (patch)
tree30f6fb63eb08c72af5855f0a784df32a64057706 /src/http/modules/proxy/ngx_http_proxy_header.c
parent980a92472cc30271ad7e88eb2dcc43f00e984d4d (diff)
downloadnginx-aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a.tar.gz
nginx-aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a.zip
nginx-0.0.10-2004-09-06-22:45:00 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_header.c')
-rw-r--r--src/http/modules/proxy/ngx_http_proxy_header.c24
1 files changed, 20 insertions, 4 deletions
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;
}