]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: listener: remove the now useless LI_F_QUIC_LISTENER flag
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Jan 2023 19:20:57 +0000 (20:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Feb 2023 17:00:20 +0000 (18:00 +0100)
This flag is only used to tag a QUIC listener, which we now know by
its bind_conf's xprt as well. It's only used to decide whether or not
to perform an extra initialization step on the listener. Let's drop it
as well as the flags field.

With the various fields and options moved, the listener struct reduced
by 48 bytes total.

include/haproxy/listener-t.h
src/cfgparse.c
src/proto_quic.c

index 6e5c4238ed13e777e22ec57673e2e7811eb0d4e3..78c6b9a938b8ff548996c6602ef8d7c5a419a1f8 100644 (file)
@@ -219,7 +219,6 @@ struct li_per_thread {
        struct listener *li; /* back reference on the listener */
 };
 
-#define LI_F_QUIC_LISTENER       0x00000001  /* listener uses proto quic */
 
 /* The listener will be directly referenced by the fdtab[] which holds its
  * socket. The listener provides the protocol-specific accept() function to
@@ -230,12 +229,11 @@ struct listener {
        enum li_state state;            /* state: NEW, INIT, ASSIGNED, LISTEN, READY, FULL */
        /* 2-byte hole here */
        int luid;                       /* listener universally unique ID, used for SNMP */
-       int flags;                      /* LI_F_* flags */
+       int nbconn;                     /* current number of connections on this listener */
        unsigned int thr_idx;           /* thread indexes for queue distribution : (t2<<16)+t1 */
        __decl_thread(HA_RWLOCK_T lock);
 
        struct fe_counters *counters;   /* statistics counters */
-       int nbconn;                     /* current number of connections on this listener */
        struct mt_list wait_queue;      /* link element to make the listener wait for something (LI_LIMITED)  */
        char *name;                     /* listener's name */
 
index 664a24a178178431ec966343c4225fa7d189593a..78b32ee8420cdb8aab667ea63369c7682f888e1c 100644 (file)
@@ -4316,7 +4316,7 @@ init_proxies_list_stage2:
                        }
 
 #ifdef USE_QUIC
-                       if (listener->flags & LI_F_QUIC_LISTENER) {
+                       if (listener->bind_conf->xprt == xprt_get(XPRT_QUIC)) {
                                if (!global.cluster_secret) {
                                        diag_no_cluster_secret = 1;
                                        if (listener->bind_conf->options & BC_O_QUIC_FORCE_RETRY) {
index 217edd9a0bf79167ab192de9ba7e35cfea9950f3..9d2755310390e6593613d8293c2f710289797273 100644 (file)
@@ -526,7 +526,6 @@ int quic_connect_server(struct connection *conn, int flags)
  */
 static void quic_add_listener(struct protocol *proto, struct listener *listener)
 {
-       listener->flags |= LI_F_QUIC_LISTENER;
        listener->rx.flags |= RX_F_LOCAL_ACCEPT;
 
        default_add_listener(proto, listener);