]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: poller: do not call the IO handler if the FD is not active
authorWilly Tarreau <w@1wt.eu>
Thu, 26 Dec 2019 10:09:43 +0000 (11:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 15:38:47 +0000 (16:38 +0100)
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.

include/proto/fd.h

index 8dd64a5b3935d621b28bd2c3edb49904b5e9db5e..a50748572a9b41b5c162e775af9c7a10e09a8da6 100644 (file)
@@ -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