]> git.kaiwu.me - nginx.git/commitdiff
Upstream keepalive: drop ready flag on EAGAIN from recv(MSG_PEEK).
authorValentin Bartenev <vbart@nginx.com>
Tue, 3 Mar 2015 14:48:57 +0000 (17:48 +0300)
committerValentin Bartenev <vbart@nginx.com>
Tue, 3 Mar 2015 14:48:57 +0000 (17:48 +0300)
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.

src/http/modules/ngx_http_upstream_keepalive_module.c

index f738f0cc18e4d1683a4399d2bc28c427f258828c..4e005fc0e01e0231fbfd3e91b5a976e13ace5494 100644 (file)
@@ -387,7 +387,7 @@ ngx_http_upstream_keepalive_close_handler(ngx_event_t *ev)
     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;