Mercurial > hg > nginx-mail
comparison src/http/ngx_http_request_body.c @ 573:4c5d2c627a6c NGINX_0_8_17
nginx 0.8.17
*) Security: now "/../" are disabled in "Destination" request header
line.
*) Change: now $host variable value is always low case.
*) Feature: the $ssl_session_id variable.
*) Bugfix: socket leak; the bug had appeared in 0.8.11.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 28 Sep 2009 00:00:00 +0400 |
parents | 80f7156c2965 |
children | f7ec98e3caeb |
comparison
equal
deleted
inserted
replaced
569:b8ac674b0ec9 | 573:4c5d2c627a6c |
---|---|
475 | 475 |
476 if (ngx_handle_read_event(rev, 0) != NGX_OK) { | 476 if (ngx_handle_read_event(rev, 0) != NGX_OK) { |
477 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 477 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
478 } | 478 } |
479 | 479 |
480 r->count++; | 480 if (ngx_http_read_discarded_request_body(r) != NGX_OK) { |
481 (void) ngx_http_read_discarded_request_body(r); | 481 r->count++; |
482 } | |
482 | 483 |
483 return NGX_OK; | 484 return NGX_OK; |
484 } | 485 } |
485 | 486 |
486 | 487 |
560 u_char buffer[NGX_HTTP_DISCARD_BUFFER_SIZE]; | 561 u_char buffer[NGX_HTTP_DISCARD_BUFFER_SIZE]; |
561 | 562 |
562 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 563 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
563 "http read discarded body"); | 564 "http read discarded body"); |
564 | 565 |
565 do { | 566 for ( ;; ) { |
566 if (r->headers_in.content_length_n == 0) { | 567 if (r->headers_in.content_length_n == 0) { |
567 r->read_event_handler = ngx_http_block_reading; | 568 r->read_event_handler = ngx_http_block_reading; |
568 return NGX_OK; | 569 return NGX_OK; |
569 } | 570 } |
570 | 571 |
572 if (!r->connection->read->ready) { | |
573 return NGX_AGAIN; | |
574 } | |
575 | |
571 size = (r->headers_in.content_length_n > NGX_HTTP_DISCARD_BUFFER_SIZE) ? | 576 size = (r->headers_in.content_length_n > NGX_HTTP_DISCARD_BUFFER_SIZE) ? |
572 NGX_HTTP_DISCARD_BUFFER_SIZE: | 577 NGX_HTTP_DISCARD_BUFFER_SIZE: |
573 (size_t) r->headers_in.content_length_n; | 578 (size_t) r->headers_in.content_length_n; |
574 | 579 |
575 n = r->connection->recv(r->connection, buffer, size); | 580 n = r->connection->recv(r->connection, buffer, size); |
586 if (n == 0) { | 591 if (n == 0) { |
587 return NGX_OK; | 592 return NGX_OK; |
588 } | 593 } |
589 | 594 |
590 r->headers_in.content_length_n -= n; | 595 r->headers_in.content_length_n -= n; |
591 | 596 } |
592 } while (r->connection->read->ready); | |
593 | |
594 return NGX_AGAIN; | |
595 } | 597 } |
596 | 598 |
597 | 599 |
598 static ngx_int_t | 600 static ngx_int_t |
599 ngx_http_test_expect(ngx_http_request_t *r) | 601 ngx_http_test_expect(ngx_http_request_t *r) |