[PATCH 1 of 3] Upstream: clearing of u->peer.connection on close

肖涵 xiaohanhoho at gmail.com
Sun Oct 9 07:22:34 UTC 2011


HI  , i want to use 1.1.4 to  instead of stable version online ,because we
need the upstream keepalive to do sth, do you recommend it?

2011/9/25 Maxim Dounin <mdounin at mdounin.ru>

> # HG changeset patch
> # User Maxim Dounin <mdounin at mdounin.ru>
> # Date 1316882053 -14400
> # Node ID f1cbffaa09dcc5e8d9f3fc888abcac8e6e7c38b3
> # Parent  6c19b251b92674710573c472e8aba406fa72da50
> Upstream: clearing of u->peer.connection on close.
>
> This fixes crashes observed with some 3rd party balancer modules.  Standard
> balancer modules (round-robin and ip hash) explicitly set pc->connection
> (aka u->peer.connection) to NULL and aren't affected.
>
> diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
> --- a/src/http/ngx_http_upstream.c
> +++ b/src/http/ngx_http_upstream.c
> @@ -2927,6 +2927,7 @@ ngx_http_upstream_next(ngx_http_request_
>         }
>
>         ngx_close_connection(u->peer.connection);
> +        u->peer.connection = NULL;
>     }
>
>  #if 0
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20111009/560b7c5f/attachment.html>


More information about the nginx-devel mailing list