Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream keepalive: drop ready flag on EAGAIN from recv(...

Valentin Bartenev
March 03, 2015 10:48AM
details: http://hg.nginx.org/nginx/rev/4d8936b1fc32
branches:
changeset: 5999:4d8936b1fc32
user: Valentin Bartenev <vbart@nginx.com>
date: Tue Mar 03 17:48:57 2015 +0300
description:
Upstream keepalive: drop ready flag on EAGAIN from recv(MSG_PEEK).

Keeping the ready flag in this case might results in missing notification of
broken connection until nginx tried to use it again.

While there, stale comment about stale event was removed since this function
is also can be called directly.

diffstat:

src/http/modules/ngx_http_upstream_keepalive_module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r ea58dfd07782 -r 4d8936b1fc32 src/http/modules/ngx_http_upstream_keepalive_module.c
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c Tue Mar 03 18:09:13 2015 +0300
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c Tue Mar 03 17:48:57 2015 +0300
@@ -387,7 +387,7 @@ ngx_http_upstream_keepalive_close_handle
n = recv(c->fd, buf, 1, MSG_PEEK);

if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
- /* stale event */
+ ev->ready = 0;

if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
goto close;

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

[nginx] Upstream keepalive: drop ready flag on EAGAIN from recv(...

Valentin Bartenev 637 March 03, 2015 10:48AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 302
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