Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 192:31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2003 07:05:50 +0000 |
parents | 71ce40b3c37b |
children | 2357fa41738a |
comparison
equal
deleted
inserted
replaced
191:71ce40b3c37b | 192:31824be1fc66 |
---|---|
155 i = 0; | 155 i = 0; |
156 | 156 |
157 if (in_port->addrs.nelts > 1) { | 157 if (in_port->addrs.nelts > 1) { |
158 | 158 |
159 /* | 159 /* |
160 * there're the several addresses on this port and one of them | 160 * There're the several addresses on this port and one of them |
161 * is "*:port" so getsockname() is needed to determine | 161 * is "*:port" so getsockname() is needed to determine |
162 * the server address. | 162 * the server address. |
163 * AcceptEx() already gave this address. | 163 * AcceptEx() already gave this address. |
164 */ | 164 */ |
165 | 165 |
344 r->unparsed_uri.len + 1); | 344 r->unparsed_uri.len + 1); |
345 | 345 |
346 | 346 |
347 r->request_line.len = r->request_end - r->request_start; | 347 r->request_line.len = r->request_end - r->request_start; |
348 | 348 |
349 /* if the large client headers are enabled then | |
350 we need to copy a request line */ | |
351 | |
352 if (cscf->large_client_header) { | 349 if (cscf->large_client_header) { |
350 | |
351 /* | |
352 * if the large client headers are enabled then | |
353 * we need to copy a request line | |
354 */ | |
353 | 355 |
354 r->request_line.data = ngx_palloc(r->pool, r->request_line.len + 1); | 356 r->request_line.data = ngx_palloc(r->pool, r->request_line.len + 1); |
355 if (r->request_line.data == NULL) { | 357 if (r->request_line.data == NULL) { |
356 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 358 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
357 ngx_http_close_connection(c); | 359 ngx_http_close_connection(c); |
364 } else { | 366 } else { |
365 r->request_line.data = r->request_start; | 367 r->request_line.data = r->request_start; |
366 r->request_line.data[r->request_line.len] = '\0'; | 368 r->request_line.data[r->request_line.len] = '\0'; |
367 } | 369 } |
368 | 370 |
369 /* copy URI extention if it exists */ | |
370 | 371 |
371 if (r->uri_ext) { | 372 if (r->uri_ext) { |
373 | |
374 /* copy URI extention */ | |
375 | |
372 if (r->args_start) { | 376 if (r->args_start) { |
373 r->exten.len = r->args_start - 1 - r->uri_ext; | 377 r->exten.len = r->args_start - 1 - r->uri_ext; |
374 } else { | 378 } else { |
375 r->exten.len = r->uri_end - r->uri_ext; | 379 r->exten.len = r->uri_end - r->uri_ext; |
376 } | 380 } |
382 } | 386 } |
383 | 387 |
384 ngx_cpystrn(r->exten.data, r->uri_ext, r->exten.len + 1); | 388 ngx_cpystrn(r->exten.data, r->uri_ext, r->exten.len + 1); |
385 } | 389 } |
386 | 390 |
387 /* copy URI arguments if they exist */ | |
388 | |
389 if (r->args_start && r->uri_end > r->args_start) { | 391 if (r->args_start && r->uri_end > r->args_start) { |
392 | |
393 /* copy URI arguments */ | |
394 | |
390 r->args.len = r->uri_end - r->args_start; | 395 r->args.len = r->uri_end - r->args_start; |
391 | 396 |
392 if (!(r->args.data = ngx_palloc(r->pool, r->args.len + 1))) { | 397 if (!(r->args.data = ngx_palloc(r->pool, r->args.len + 1))) { |
393 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 398 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
394 ngx_http_close_connection(c); | 399 ngx_http_close_connection(c); |
444 | 449 |
445 if (r->header_in->last == r->header_in->end) { | 450 if (r->header_in->last == r->header_in->end) { |
446 | 451 |
447 /* | 452 /* |
448 * If it's a pipelined request and a request line is not complete | 453 * If it's a pipelined request and a request line is not complete |
449 * then we need to copy it to the start of the r->header_in hunk. | 454 * then we have to copy it to the start of the r->header_in hunk. |
450 * We need to copy it here only if the large client headers | 455 * We have to copy it here only if the large client headers |
451 * are enabled otherwise a request line had been already copied | 456 * are enabled otherwise a request line had been already copied |
452 * to the start of the r->header_in hunk in ngx_http_set_keepalive(). | 457 * to the start of the r->header_in hunk in ngx_http_set_keepalive(). |
453 */ | 458 */ |
454 | 459 |
455 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | 460 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |