MINOR: fd: Don't forget to reset fdtab[fd].update when a fd is added/removed

It used to be guaranteed by the polling functions on a later call but
with concurrent accesses it cannot be granted anymore.
This commit is contained in:
Christopher Faulet 2017-06-01 16:55:03 +02:00 committed by Willy Tarreau
parent f5b8adc5c0
commit d531f88622
2 changed files with 4 additions and 2 deletions

View File

@ -338,6 +338,7 @@ static inline void fd_insert(int fd)
{
fdtab[fd].ev = 0;
fdtab[fd].new = 1;
fdtab[fd].updated = 0;
fdtab[fd].linger_risk = 0;
fdtab[fd].cloned = 0;
if (fd + 1 > maxfd)

View File

@ -190,10 +190,11 @@ static void fd_dodelete(int fd, int do_close)
port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port);
fdinfo[fd].port_range = NULL;
fdtab[fd].owner = NULL;
fdtab[fd].updated = 0;
fdtab[fd].new = 0;
if (do_close)
close(fd);
fdtab[fd].owner = NULL;
fdtab[fd].new = 0;
while ((maxfd-1 >= 0) && !fdtab[maxfd-1].owner)
maxfd--;