mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-07 01:31:35 +00:00
MINOR: fd: add fd_want_recv_safe()
This does the same as fd_want_recv() except that it does check for fd_updt[] to be allocated, as this may be called during early listener initialization. Previously we used to check fd_updt[] before calling fd_want_recv() but this is not correct since it does not update the FD flags. This method will be safer.
This commit is contained in:
parent
22ccd5ebaf
commit
7e98e28eb0
@ -288,6 +288,18 @@ static inline void fd_want_recv(int fd)
|
|||||||
updt_fd_polling(fd);
|
updt_fd_polling(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Prepare FD <fd> to try to receive, and only create update if fd_updt exists
|
||||||
|
* (essentially for receivers during early boot).
|
||||||
|
*/
|
||||||
|
static inline void fd_want_recv_safe(int fd)
|
||||||
|
{
|
||||||
|
if ((fdtab[fd].state & FD_EV_ACTIVE_R) ||
|
||||||
|
HA_ATOMIC_BTS(&fdtab[fd].state, FD_EV_ACTIVE_R_BIT))
|
||||||
|
return;
|
||||||
|
if (fd_updt)
|
||||||
|
updt_fd_polling(fd);
|
||||||
|
}
|
||||||
|
|
||||||
/* Prepare FD <fd> to try to send */
|
/* Prepare FD <fd> to try to send */
|
||||||
static inline void fd_want_send(int fd)
|
static inline void fd_want_send(int fd)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user