diff src/http/modules/ngx_http_upstream_keepalive_module.c @ 5999:4d8936b1fc32

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.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 03 Mar 2015 17:48:57 +0300
parents 39befd3c0d84
children 87d48f8793b6
line wrap: on
line diff
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c
@@ -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;