[PATCH] Fix "$upstream_response_length" for upstream requests with buffering off

Piotr Sikora piotr at cloudflare.com
Thu Apr 11 04:38:35 UTC 2013


Hey,
the value of "$upstream_response_length" variable is being incorrectly
reported as "0" for upstream requests with buffering off.

Attached patch fixes this.

Best regards,
Piotr Sikora


diff -r 482fda984556 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c      Wed Apr 10 17:07:44 2013 +0000
+++ b/src/http/ngx_http_upstream.c      Wed Apr 10 21:29:59 2013 -0700
@@ -3307,7 +3307,7 @@
         u->state->response_sec = tp->sec - u->state->response_sec;
         u->state->response_msec = tp->msec - u->state->response_msec;

-        if (u->pipe) {
+        if (u->pipe->read_length) {
             u->state->response_length = u->pipe->read_length;
         }
     }



More information about the nginx-devel mailing list