aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorAndrey Belov <defan@nginx.com>2012-07-06 04:27:06 +0000
committerAndrey Belov <defan@nginx.com>2012-07-06 04:27:06 +0000
commit3d87bcf9aedbd479c89bdae5b8c2ae82fd7106d2 (patch)
tree2c2002fbb3ab71e91efdf278a4d76c6e5f46254b /src/http/ngx_http_request.c
parentbbfc96c7034bff4e94cf80538d630d06bd2334ee (diff)
downloadnginx-3d87bcf9aedbd479c89bdae5b8c2ae82fd7106d2.tar.gz
nginx-3d87bcf9aedbd479c89bdae5b8c2ae82fd7106d2.zip
Corrected $request_length calculation for pipelined requests.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index e0ae5241f..26420b164 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -747,6 +747,7 @@ ngx_http_process_request_line(ngx_event_t *rev)
r->request_line.len = r->request_end - r->request_start;
r->request_line.data = r->request_start;
+ r->request_length = r->header_in->pos - r->request_start;
if (r->args_start) {
@@ -1056,6 +1057,8 @@ ngx_http_process_request_headers(ngx_event_t *rev)
if (rc == NGX_OK) {
+ r->request_length += r->header_in->pos - r->header_name_start;
+
if (r->invalid_header && cscf->ignore_invalid_headers) {
/* there was error while a header line parsing */
@@ -1119,7 +1122,7 @@ 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->request_length += r->header_in->pos - r->header_name_start;
r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
@@ -1226,8 +1229,6 @@ 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;
@@ -1287,8 +1288,6 @@ 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;
@@ -1297,8 +1296,6 @@ 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);