Welcome! Log In Create A New Profile

Advanced

Re: Proposal minor patch on ngx_http_upstream.c

Ruslan Ermilov
June 02, 2014 10:20AM
On Mon, Jun 02, 2014 at 09:51:42AM -0400, crespin wrote:
> Hello,
>
> errno is only set on error, so if |recv()| is a success, |err| will have a
> random value.
> Only debug message are impacted.
> Can you check if it is ok?
> Comments are welcome.
> Feel free to change the patch.
>
> Regards,
>
> yves
>
>
> ---
> nginx-1.6.0/src/http/ngx_http_upstream.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/nginx-1.6.0/src/http/ngx_http_upstream.c
> b/nginx-1.6.0/src/http/ngx
> index 040bda1..f60acb3 100644
> --- a/nginx-1.6.0/src/http/ngx_http_upstream.c
> +++ b/nginx-1.6.0/src/http/ngx_http_upstream.c
> @@ -1128,7 +1128,7 @@
> ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
>
> n = recv(c->fd, buf, 1, MSG_PEEK);
>
> - err = ngx_socket_errno;
> + err = n == 1 ? ngx_socket_errno : 0;

(n == -1)

>
> ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, err,
> "http upstream recv(): %d", n);
> @@ -1158,9 +1158,6 @@
> ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
> }
>
> ev->error = 1;
> -
> - } else { /* n == 0 */
> - err = 0;
> }
>
> ev->eof = 1;
>
> --
> 1.7.10.4
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250570,250570#msg-250570
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

--
Ruslan Ermilov

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proposal minor patch on ngx_http_upstream.c

crespin June 02, 2014 09:51AM

Re: Proposal minor patch on ngx_http_upstream.c

Ruslan Ermilov June 02, 2014 10:20AM

Re: Proposal minor patch on ngx_http_upstream.c

crespin June 02, 2014 11:37AM

Re: Proposal minor patch on ngx_http_upstream.c

crespin August 08, 2014 02:49AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 311
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready