MINOR: connection: add a new flag CO_FL_FDLESS on fd-less connections

QUIC connections do not use a file descriptor, instead they use the
quic equivalent which is the quic_conn. A number of our historical
functions at the connection level continue to unconditionally touch
the file descriptor and this may have consequences once QUIC starts
to be used.

This patch adds a new flag on QUIC connections, CO_FL_FDLESS, to
mention that the connection doesn't have a file descriptor, hence the
FD-based API must never be used on them.

From now on it will be possible to intrument existing functions to
panic when this flag is present.
This commit is contained in:
Willy Tarreau 2022-04-11 17:26:56 +02:00
parent e4d09cedb6
commit c78a9698ef
2 changed files with 3 additions and 1 deletions

View File

@ -116,6 +116,8 @@ enum {
CO_FL_ERROR = 0x00100000, /* a fatal error was reported */
CO_FL_NOTIFY_DONE = 0x001C0000, /* any xprt shut/error flags above needs to be reported */
CO_FL_FDLESS = 0x00200000, /* this connection doesn't use any FD (e.g. QUIC) */
/* flags used to report connection status updates */
CO_FL_WAIT_L4_CONN = 0x00400000, /* waiting for L4 to be connected */
CO_FL_WAIT_L6_CONN = 0x00800000, /* waiting for L6 to be connected (eg: SSL) */

View File

@ -101,7 +101,7 @@ static int new_quic_cli_conn(struct quic_conn *qc, struct listener *l,
if (!sockaddr_alloc(&cli_conn->src, saddr, sizeof *saddr))
goto out_free_conn;
cli_conn->flags |= CO_FL_ADDR_FROM_SET;
cli_conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_FDLESS;
qc->conn = cli_conn;
cli_conn->qc = qc;