Welcome! Log In Create A New Profile

Advanced

Proposal minor patch on ngx_http_upstream.c

June 02, 2014 09:51AM
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;

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
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: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready