From 7a7650aeb16ee21a5f596cd855c97066726c00a8 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Thu, 11 Apr 2013 13:49:13 +0000 Subject: [PATCH] Upstream: fixed $upstream_response_length without buffering. Reported by Piotr Sikora. --- src/http/ngx_http_upstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index a7e88b777..45e2eb7b9 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -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; } }