Mercurial > hg > nginx-quic
comparison 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 |
comparison
equal
deleted
inserted
replaced
5998:ea58dfd07782 | 5999:4d8936b1fc32 |
---|---|
385 } | 385 } |
386 | 386 |
387 n = recv(c->fd, buf, 1, MSG_PEEK); | 387 n = recv(c->fd, buf, 1, MSG_PEEK); |
388 | 388 |
389 if (n == -1 && ngx_socket_errno == NGX_EAGAIN) { | 389 if (n == -1 && ngx_socket_errno == NGX_EAGAIN) { |
390 /* stale event */ | 390 ev->ready = 0; |
391 | 391 |
392 if (ngx_handle_read_event(c->read, 0) != NGX_OK) { | 392 if (ngx_handle_read_event(c->read, 0) != NGX_OK) { |
393 goto close; | 393 goto close; |
394 } | 394 } |
395 | 395 |