comparison src/http/ngx_http_request_body.c @ 332:3a91bfeffaba NGINX_0_6_10

nginx 0.6.10 *) Feature: the "open_file_cache", "open_file_cache_retest", and "open_file_cache_errors" directives. *) Bugfix: socket leak; bug appeared in 0.6.7. *) Bugfix: a charset set by the "charset" directive was not appended to the "Content-Type" header set by $r->send_http_header(). *) Bugfix: a segmentation fault might occur in worker process if /dev/poll method was used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 03 Sep 2007 00:00:00 +0400
parents 5e3b425174f6
children 4276c2f1f434
comparison
equal deleted inserted replaced
331:b69d5e83bf82 332:3a91bfeffaba
444 444
445 if (r->headers_in.content_length_n <= 0) { 445 if (r->headers_in.content_length_n <= 0) {
446 return NGX_OK; 446 return NGX_OK;
447 } 447 }
448 448
449 r->discard_body = 1;
450
451 size = r->header_in->last - r->header_in->pos; 449 size = r->header_in->last - r->header_in->pos;
452 450
453 if (size) { 451 if (size) {
454 if (r->headers_in.content_length_n > size) { 452 if (r->headers_in.content_length_n > size) {
455 r->headers_in.content_length_n -= size; 453 r->headers_in.content_length_n -= size;
458 r->header_in->pos += (size_t) r->headers_in.content_length_n; 456 r->header_in->pos += (size_t) r->headers_in.content_length_n;
459 r->headers_in.content_length_n = 0; 457 r->headers_in.content_length_n = 0;
460 return NGX_OK; 458 return NGX_OK;
461 } 459 }
462 } 460 }
461
462 r->discard_body = 1;
463 463
464 r->read_event_handler = ngx_http_read_discarded_request_body_handler; 464 r->read_event_handler = ngx_http_read_discarded_request_body_handler;
465 465
466 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) { 466 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
467 return NGX_HTTP_INTERNAL_SERVER_ERROR; 467 return NGX_HTTP_INTERNAL_SERVER_ERROR;
519 } 519 }
520 520
521 /* rc == NGX_AGAIN */ 521 /* rc == NGX_AGAIN */
522 522
523 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) { 523 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
524 c->error = 1;
524 ngx_http_finalize_request(r, rc); 525 ngx_http_finalize_request(r, rc);
525 return; 526 return;
526 } 527 }
527 528
528 if (timer) { 529 if (timer) {