comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 158:d377ee423603

nginx-0.0.1-2003-10-24-10:53:41 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 24 Oct 2003 06:53:41 +0000
parents afc333135a6b
children 981e4af2a425
comparison
equal deleted inserted replaced
157:70b36c805682 158:d377ee423603
186 p->uri.len = 1; 186 p->uri.len = 1;
187 p->location_len = 1; 187 p->location_len = 1;
188 188
189 /* STUB */ p->accel = 1; 189 /* STUB */ p->accel = 1;
190 190
191 p->host_header = p->upstream.peers->peers[0].host;
192
193 ngx_test_null(p->request_hunks, ngx_http_proxy_create_request(p), 191 ngx_test_null(p->request_hunks, ngx_http_proxy_create_request(p),
194 NGX_HTTP_INTERNAL_SERVER_ERROR); 192 NGX_HTTP_INTERNAL_SERVER_ERROR);
195 193
196 p->action = "connecting to upstream"; 194 p->action = "connecting to upstream";
197 195
218 len = http_methods[p->method - 1].len 216 len = http_methods[p->method - 1].len
219 + p->uri.len 217 + p->uri.len
220 + r->uri.len - p->location_len 218 + r->uri.len - p->location_len
221 + 1 + r->args.len /* 1 is for "?" */ 219 + 1 + r->args.len /* 1 is for "?" */
222 + sizeof(http_version) - 1 220 + sizeof(http_version) - 1
223 + sizeof(host_header) - 1 + p->host_header.len + 2 221 + sizeof(host_header) - 1 + p->lcf->upstream->host_header.len + 2
224 /* 2 is for "\r\n" */ 222 /* 2 is for "\r\n" */
225 + sizeof(connection_close_header) - 1 223 + sizeof(connection_close_header) - 1
226 + 2; /* 2 is for "\r\n" at the header end */ 224 + 2; /* 2 is for "\r\n" at the header end */
227 225
228 header = (ngx_table_elt_t *) r->headers_in.headers->elts; 226 header = (ngx_table_elt_t *) r->headers_in.headers->elts;
266 264
267 265
268 /* the "Host" header */ 266 /* the "Host" header */
269 267
270 h->last = ngx_cpymem(h->last, host_header, sizeof(host_header) - 1); 268 h->last = ngx_cpymem(h->last, host_header, sizeof(host_header) - 1);
271 h->last = ngx_cpymem(h->last, p->host_header.data, p->host_header.len); 269 h->last = ngx_cpymem(h->last, p->lcf->upstream->host_header.data,
270 p->lcf->upstream->host_header.len);
272 *(h->last++) = CR; *(h->last++) = LF; 271 *(h->last++) = CR; *(h->last++) = LF;
273 272
274 273
275 /* the "Connection: close" header */ 274 /* the "Connection: close" header */
276 275