]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: connection: add conn_fd() to retrieve the FD only when it exists
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Apr 2022 15:54:46 +0000 (17:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Apr 2022 17:31:47 +0000 (19:31 +0200)
commit83a966d02593cb9790b19f51b3eb688612cec7d3
treee96ec08bbeb8097180c88de00d58541fd7287cef
parentc78a9698ef82d49a08f71fcfbb5341fbb004119d
MINOR: connection: add conn_fd() to retrieve the FD only when it exists

There are plenty of places (particularly in debug code) where we try to
dump the connection's FD only when the connection is defined. That's
already a pain but now it gets one step further with QUIC because we do
*not* want to dump this FD in this case.

conn_fd() checks if the connection exists, is ready and is not fd-less,
and returns the FD only in this case, otherwise returns -1. This aims at
simplifying most of these conditions.
include/haproxy/connection.h