[nginx] svn commit: r4790 - in branches/stable-1.2: . src/http

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Aug 6 15:45:44 UTC 2012


Author: mdounin
Date: 2012-08-06 15:45:44 +0000 (Mon, 06 Aug 2012)
New Revision: 4790
URL: http://trac.nginx.org/nginx/changeset/4790/nginx

Log:
Merge of r4740: fixed $request_length for pipelined requests.


Modified:
   branches/stable-1.2/
   branches/stable-1.2/src/http/ngx_http_request.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2012-08-06 15:31:49 UTC (rev 4789)
+++ branches/stable-1.2	2012-08-06 15:45:44 UTC (rev 4790)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740
\ No newline at end of property
Modified: branches/stable-1.2/src/http/ngx_http_request.c
===================================================================
--- branches/stable-1.2/src/http/ngx_http_request.c	2012-08-06 15:31:49 UTC (rev 4789)
+++ branches/stable-1.2/src/http/ngx_http_request.c	2012-08-06 15:45:44 UTC (rev 4790)
@@ -747,6 +747,7 @@
 
             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 @@
 
         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_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 @@
 
         /* 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 @@
          * 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_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);



More information about the nginx-devel mailing list