]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed $upstream_response_length without buffering.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 11 Apr 2013 13:49:13 +0000 (13:49 +0000)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 11 Apr 2013 13:49:13 +0000 (13:49 +0000)
Reported by Piotr Sikora.

src/http/ngx_http_upstream.c

index a7e88b77720d7e619db972b2ff04a91adc46f7c6..45e2eb7b96127dee995063636c6afa23f6daebd6 100644 (file)
@@ -3307,7 +3307,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
         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 && u->pipe->read_length) {
             u->state->response_length = u->pipe->read_length;
         }
     }