]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: add a new FD_DISOWN flag to prevent from closing a deleted FD
authorEmeric Brun <ebrun@haproxy.com>
Fri, 1 Jul 2022 15:31:25 +0000 (17:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 15:41:40 +0000 (17:41 +0200)
commitf41a3f6762ce3ccc79f016a052ac03863de7d49d
tree601140a251b7b0f73a9ec9dafdef79f02b76c5b7
parent6befccd8a15c1bfb4d70627a1d4569c1c57f05f5
MINOR: fd: add a new FD_DISOWN flag to prevent from closing a deleted FD

Some FDs might be offered to some external code (external libraries)
which will deal with them until they close them. As such we must not
close them upon fd_delete() but we need to delete them anyway so that
they do not appear anymore in the fdtab. This used to be handled by
fd_remove() before 2.3 but we don't have this anymore.

This patch introduces a new flag FD_DISOWN to let fd_delete() know that
the core doesn't own the fd and it must not be closed upon removal from
the fd_tab. This way it's totally unregistered from the poller but still
open.

This patch must be backported on branches >= 2.3 because it will be
needed to fix a bug affecting SSL async. it should be adapted on 2.3
because state flags were stored in a different way (via bits in the
structure).
include/haproxy/fd-t.h
src/fd.c