diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-12-06 14:45:08 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-12-06 14:45:08 +0000 |
commit | 6a12fc91b0090b5628dc70d4a45db576c5b0c64a (patch) | |
tree | f473f81772c058b7488ac4030c3ff09994c6c532 /src/http/ngx_http_request.c | |
parent | c372e09ab34ec8c4f60f8c08ef30b297c0e475ab (diff) | |
download | nginx-6a12fc91b0090b5628dc70d4a45db576c5b0c64a.tar.gz nginx-6a12fc91b0090b5628dc70d4a45db576c5b0c64a.zip |
nginx-0.1.12-RELEASE importrelease-0.1.12
*) Feature: the %request_length log parameter.
*) Bugfix: when using the /dev/poll, select and poll on the platforms,
where these methods may do the false reports, there may be the long
delay when the request was passed via the keep-alive connection. It
may be at least on Solaris when using the /dev/poll.
*) Bugfix: the send_lowat directive is ignored on Linux because Linux
does not support the SO_SNDLOWAT option.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index fe3d516cf..b2c35169e 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -795,6 +795,8 @@ static void ngx_http_process_request_headers(ngx_event_t *rev) ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http header done"); + r->request_length += r->header_in->pos - r->header_in->start; + r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; rc = ngx_http_process_request_header(r); @@ -922,6 +924,8 @@ static ngx_int_t ngx_http_alloc_large_header_buffer(ngx_http_request_t *r, /* the client fills up the buffer with "\r\n" */ + r->request_length += r->header_in->end - r->header_in->start; + r->header_in->pos = r->header_in->start; r->header_in->last = r->header_in->start; @@ -981,6 +985,8 @@ static ngx_int_t ngx_http_alloc_large_header_buffer(ngx_http_request_t *r, * to relocate the parser header pointers */ + r->request_length += r->header_in->end - r->header_in->start; + r->header_in = b; return NGX_OK; @@ -989,6 +995,8 @@ static ngx_int_t ngx_http_alloc_large_header_buffer(ngx_http_request_t *r, ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http large header copy: %d", r->header_in->pos - old); + r->request_length += old - r->header_in->start; + new = b->start; ngx_memcpy(new, old, r->header_in->pos - old); @@ -1810,6 +1818,10 @@ static void ngx_http_keepalive_handler(ngx_event_t *rev) c->log_error = NGX_ERROR_INFO; if (n == NGX_AGAIN) { + if (ngx_handle_level_read_event(rev) == NGX_ERROR) { + ngx_http_close_connection(c); + } + return; } @@ -1932,6 +1944,11 @@ static void ngx_http_lingering_close_handler(ngx_event_t *rev) } while (rev->ready); + if (ngx_handle_level_read_event(rev) == NGX_ERROR) { + ngx_http_close_connection(c); + return; + } + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); timer *= 1000; |