[PATCH] Upstream: fixed $upstream_response_time for filter_finalize + error_page.
Maxim Dounin
mdounin at mdounin.ru
Fri Feb 13 17:34:10 UTC 2015
Hello!
On Fri, Feb 13, 2015 at 06:05:12PM +0300, Maxim Dounin wrote:
[...]
> Rather, I would suggest something like this:
>
> --- a/src/http/ngx_http_upstream.c
> +++ b/src/http/ngx_http_upstream.c
> @@ -3744,10 +3744,13 @@ ngx_http_upstream_finalize_request(ngx_h
> ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
> "finalize http upstream request: %i", rc);
>
> - if (u->cleanup) {
> - *u->cleanup = NULL;
> - u->cleanup = NULL;
> - }
> + if (u->cleanup == NULL) {
> + /* the request was already finalized */
> + ngx_http_finalize_request(r, NGX_DONE);
Err, return should be here.
> + }
> +
> + *u->cleanup = NULL;
> + u->cleanup = NULL;
>
> if (u->resolved && u->resolved->ctx) {
> ngx_resolve_name_done(u->resolved->ctx);
>
> (Untested though.)
--
Maxim Dounin
http://nginx.org/
More information about the nginx-devel
mailing list