Welcome! Log In Create A New Profile

Advanced

Re: Proposal minor patch on ngx_http_upstream.c

August 08, 2014 02:49AM
Hello,

Here is the corresponding patch.

Regards,

yves


# HG changeset patch
# User Yves Crespin<yves.crespin@e-quartz.fr>
# Date 1407480323 -7200
# Node ID a62fffc16af816612a4acf34c7a4781f454fa5d1
# Parent 8120c2937062998497546a3ecb38b78bb302fe34
Upstream: ngx_socket_errno can only be used if |recv()| failed

if |recv()| is a success, err will have a random value.
only debug message are impacted.

diff -r 8120c2937062 -r a62fffc16af8 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Thu Aug 07 16:04:07 2014 +0200
+++ b/src/http/ngx_http_upstream.c Fri Aug 08 08:45:23 2014 +0200
@@ -1145,7 +1145,7 @@

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);
@@ -1175,9 +1175,6 @@
}

ev->error = 1;
-
- } else { /* n == 0 */
- err = 0;
}

ev->eof = 1;
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: 97
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