aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-04-14 09:53:38 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-04-14 09:53:38 +0000
commit8a2b2fb4fbd1801a5fb70d86384f2c6fd13c32c3 (patch)
treec0f7531cdc57da852f65d2d02bf11888bba63fe6 /src/http/ngx_http_request.c
parent2b1b55d025e0444978e1fcf4580217eb391860e0 (diff)
downloadnginx-8a2b2fb4fbd1801a5fb70d86384f2c6fd13c32c3.tar.gz
nginx-8a2b2fb4fbd1801a5fb70d86384f2c6fd13c32c3.zip
nginx-0.3.38-RELEASE importrelease-0.3.38
*) Feature: the ngx_http_dav_module. *) Change: the ngx_http_perl_module optimizations. Thanks to Sergey Skvortsov. *) Feature: the ngx_http_perl_module supports the $r->request_body_file method. *) Feature: the "client_body_in_file_only" directive. *) Workaround: now on disk overflow nginx tries to write access logs once a second only. Thanks to Anton Yuzhaninov and Maxim Dounin. *) Bugfix: now the "limit_rate" directive more precisely limits rate if rate is more than 100 Kbyte/s. Thanks to ForJest. *) Bugfix: now the IMAP/POP3 proxy escapes the "\r" and "\n" symbols in login and password to pass authorization server. Thanks to Maxim Dounin.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 103db1788..c296c9464 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -32,9 +32,6 @@ static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r);
static void ngx_http_writer(ngx_http_request_t *r);
static void ngx_http_block_read(ngx_http_request_t *r);
-static void ngx_http_read_discarded_body_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_read_discarded_body(ngx_http_request_t *r);
-
static void ngx_http_set_keepalive(ngx_http_request_t *r);
static void ngx_http_keepalive_handler(ngx_event_t *ev);
static void ngx_http_set_lingering_close(ngx_http_request_t *r);
@@ -1682,117 +1679,6 @@ ngx_http_block_read(ngx_http_request_t *r)
}
-ngx_int_t
-ngx_http_discard_body(ngx_http_request_t *r)
-{
- ssize_t size;
- ngx_event_t *rev;
-
- if (r != r->main) {
- return NGX_OK;
- }
-
- rev = r->connection->read;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http set discard body");
-
- if (rev->timer_set) {
- ngx_del_timer(rev);
- }
-
- if (r->headers_in.content_length_n <= 0) {
- return NGX_OK;
- }
-
- r->discard_body = 1;
-
- size = r->header_in->last - r->header_in->pos;
-
- if (size) {
- if (r->headers_in.content_length_n > size) {
- r->headers_in.content_length_n -= size;
-
- } else {
- r->header_in->pos += r->headers_in.content_length_n;
- r->headers_in.content_length_n = 0;
- return NGX_OK;
- }
- }
-
- r->read_event_handler = ngx_http_read_discarded_body_handler;
-
- if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- return ngx_http_read_discarded_body(r);
-}
-
-
-static void
-ngx_http_read_discarded_body_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
-
- rc = ngx_http_read_discarded_body(r);
-
- if (rc == NGX_AGAIN) {
- if (ngx_handle_read_event(r->connection->read, 0) == NGX_ERROR) {
- ngx_http_close_request(r, rc);
- return;
- }
- }
-
- if (rc != NGX_OK) {
- ngx_http_close_request(r, rc);
- }
-}
-
-
-static ngx_int_t
-ngx_http_read_discarded_body(ngx_http_request_t *r)
-{
- ssize_t size, n;
- u_char buffer[NGX_HTTP_DISCARD_BUFFER_SIZE];
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http read discarded body");
-
- if (r->headers_in.content_length_n == 0) {
- return NGX_OK;
- }
-
-
- size = r->headers_in.content_length_n;
-
- if (size > NGX_HTTP_DISCARD_BUFFER_SIZE) {
- size = NGX_HTTP_DISCARD_BUFFER_SIZE;
- }
-
- n = r->connection->recv(r->connection, buffer, size);
-
- if (n == NGX_ERROR) {
-
- r->connection->error = 1;
-
- /*
- * if a client request body is discarded then we already set
- * some HTTP response code for client and we can ignore the error
- */
-
- return NGX_OK;
- }
-
- if (n == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- r->headers_in.content_length_n -= n;
-
- return NGX_OK;
-}
-
-
static void
ngx_http_set_keepalive(ngx_http_request_t *r)
{