Skip to content

Commit 1999558

Browse files
committed
check active close from peer in ngx_http_check_recv_handler()
If there is no data to receive, we finish the health check before timeout. Note that, without this patch, timeout handler will do it for us.
1 parent 327249c commit 1999558

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ngx_http_upstream_check_handler.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,12 @@ ngx_http_check_recv_handler(ngx_event_t *event)
659659
switch (rc) {
660660

661661
case NGX_AGAIN:
662+
/* The peer has closed its half side of the connection. */
663+
if (size == 0) {
664+
ngx_http_check_status_update(peer, 0);
665+
break;
666+
}
667+
662668
return;
663669

664670
case NGX_ERROR:

0 commit comments

Comments
 (0)