diff --git a/src/connection.c b/src/connection.c index 7a2ab2499..320a387d7 100644 --- a/src/connection.c +++ b/src/connection.c @@ -71,7 +71,7 @@ void conn_fd_handler(int fd) conn->xprt_done_cb && conn->xprt_done_cb(conn) < 0) return; - if (conn->xprt && fd_send_ready(fd)) { + if (conn->xprt && fd_send_ready(fd) && fd_send_active(fd)) { /* force reporting of activity by clearing the previous flags : * we'll have at least ERROR or CONNECTED at the end of an I/O, * both of which will be detected below. @@ -99,7 +99,7 @@ void conn_fd_handler(int fd) * that we must absolutely test conn->xprt at each step in case it suddenly * changes due to a quick unexpected close(). */ - if (conn->xprt && fd_recv_ready(fd)) { + if (conn->xprt && fd_recv_ready(fd) && fd_recv_active(fd)) { /* force reporting of activity by clearing the previous flags : * we'll have at least ERROR or CONNECTED at the end of an I/O, * both of which will be detected below.