comparison src/http/modules/proxy/ngx_http_proxy_header.c @ 416:b9bd635011de

nginx-0.0.10-2004-09-06-22:45:00 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 06 Sep 2004 18:45:00 +0000
parents ca9a7f8c86da
children da8c5707af39
comparison
equal deleted inserted replaced
415:3c56e834be46 416:b9bd635011de
10 10
11 int ngx_http_proxy_copy_header(ngx_http_proxy_ctx_t *p, 11 int ngx_http_proxy_copy_header(ngx_http_proxy_ctx_t *p,
12 ngx_http_proxy_headers_in_t *headers_in) 12 ngx_http_proxy_headers_in_t *headers_in)
13 { 13 {
14 ngx_uint_t i; 14 ngx_uint_t i;
15 ngx_list_part_t *part;
15 ngx_table_elt_t *ho, *h; 16 ngx_table_elt_t *ho, *h;
16 ngx_http_request_t *r; 17 ngx_http_request_t *r;
17 18
18 r = p->request; 19 r = p->request;
19 20
21 part = &headers_in->headers.part;
22 h = part->elts;
23
24 #if 0
20 h = headers_in->headers.elts; 25 h = headers_in->headers.elts;
21 for (i = 0; i < headers_in->headers.nelts; i++) { 26 for (i = 0; i < headers_in->headers.nelts; i++) {
27 #endif
28
29 for (i = 0 ; /* void */; i++) {
30
31 if (i >= part->nelts) {
32 if (part->next == NULL) {
33 break;
34 }
35
36 part = part->next;
37 h = part->elts;
38 i = 0;
39 }
22 40
23 /* ignore some headers */ 41 /* ignore some headers */
24 42
25 if (&h[i] == headers_in->connection) { 43 if (&h[i] == headers_in->connection) {
26 continue; 44 continue;
67 } 85 }
68 86
69 87
70 /* copy some header pointers and set up r->headers_out */ 88 /* copy some header pointers and set up r->headers_out */
71 89
72 if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) 90 if (!(ho = ngx_list_push(&r->headers_out.headers))) {
73 {
74 return NGX_ERROR; 91 return NGX_ERROR;
75 } 92 }
76 93
77 *ho = h[i]; 94 *ho = h[i];
78 95
136 ngx_http_proxy_upstream_conf_t *uc; 153 ngx_http_proxy_upstream_conf_t *uc;
137 154
138 r = p->request; 155 r = p->request;
139 uc = p->lcf->upstream; 156 uc = p->lcf->upstream;
140 157
141 location = ngx_http_add_header(&r->headers_out, ngx_http_headers_out); 158 if (!(location = ngx_list_push(&r->headers_out.headers))) {
142 if (location == NULL) {
143 return NGX_ERROR; 159 return NGX_ERROR;
144 } 160 }
145 161
146 /* 162 /*
147 * we do not set r->headers_out.location to avoid the handling 163 * we do not set r->headers_out.location to avoid the handling