mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-29 17:51:22 +02:00
BUG/MEDIUM: fd: Always reset the polled_mask bits in fd_dodelete().
In fd_dodelete(), always reset the polled_mask bits, instead on only doing it if we're closing the file descriptor. We call the poller clo() method anyway, and failing to do so means that if fd_remove() is used while the fd is polled, the poller won't attempt to poll on a fd with the same value as the old one. This leads to fd being stuck in the SSL code while using the async engine. This should be backported to 2.0, 1.9 and 1.8.
This commit is contained in:
parent
214758211e
commit
c22580c2cc
2
src/fd.c
2
src/fd.c
@ -330,6 +330,7 @@ static void fd_dodelete(int fd, int do_close)
|
||||
}
|
||||
if (cur_poller.clo)
|
||||
cur_poller.clo(fd);
|
||||
polled_mask[fd].poll_recv = polled_mask[fd].poll_send = 0;
|
||||
|
||||
fdtab[fd].state = 0;
|
||||
|
||||
@ -338,7 +339,6 @@ static void fd_dodelete(int fd, int do_close)
|
||||
fdtab[fd].owner = NULL;
|
||||
fdtab[fd].thread_mask = 0;
|
||||
if (do_close) {
|
||||
polled_mask[fd].poll_recv = polled_mask[fd].poll_send = 0;
|
||||
close(fd);
|
||||
_HA_ATOMIC_SUB(&ha_used_fds, 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user