From: Willy Tarreau Date: Thu, 26 Dec 2019 10:09:43 +0000 (+0100) Subject: MINOR: poller: do not call the IO handler if the FD is not active X-Git-Tag: v2.2-dev1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19689882e61d33655a259a7a3707edee1866323e;p=thirdparty%2Fhaproxy.git MINOR: poller: do not call the IO handler if the FD is not active For now this almost never happens but with subsequent patches it will become more important not to uselessly call the I/O handlers if the FD is not active. --- diff --git a/include/proto/fd.h b/include/proto/fd.h index 8dd64a5b39..a50748572a 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -358,7 +358,7 @@ static inline void fd_update_events(int fd, unsigned char evts) if (fdtab[fd].ev & (FD_POLL_OUT | FD_POLL_ERR)) fd_may_send(fd); - if (fdtab[fd].iocb) + if (fdtab[fd].iocb && fd_active(fd)) fdtab[fd].iocb(fd); ti->flags &= ~TI_FL_STUCK; // this thread is still running