]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: quic: Rename some (quic|qc)_conn* objects to quic_conn_closed
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Nov 2023 07:29:12 +0000 (08:29 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Nov 2023 14:47:16 +0000 (15:47 +0100)
These objects could be confused with the ones defined by the congestion control
part (quic_cc.c).

include/haproxy/quic_conn-t.h
include/haproxy/quic_conn.h
src/quic_conn.c
src/quic_rx.c

index 9a7e64dba2c1e56f6afa2beb6a7781588ded758a..60d3840e2c55b9b86825dfe3194e4bdbf900ec53 100644 (file)
@@ -435,7 +435,7 @@ struct quic_conn {
 };
 
 /* QUIC connection in "connection close" state. */
-struct quic_cc_conn {
+struct quic_conn_closed {
        QUIC_CONN_COMMON;
        char *cc_buf_area;
        /* Length of the "connection close" datagram. */
index a7a731d376f8df53464b4a488542ae2694c0f2e9..ee11c5e237133bf1b2b464d7f25035aff34a54aa 100644 (file)
@@ -64,7 +64,7 @@ struct quic_connection_id *new_quic_cid(struct eb_root *root,
                                         struct quic_conn *qc,
                                         const struct quic_cid *orig,
                                         const struct sockaddr_storage *addr);
-void qc_cc_err_count_inc(struct quic_conn *qc, struct quic_frame *frm);
+void quic_conn_closed_err_count_inc(struct quic_conn *qc, struct quic_frame *frm);
 int qc_h3_request_reject(struct quic_conn *qc, uint64_t id);
 int qc_build_new_connection_id_frm(struct quic_conn *qc,
                                    struct quic_connection_id *conn_id);
@@ -116,7 +116,7 @@ static inline void free_quic_conn_cids(struct quic_conn *conn)
 }
 
 /* Move all the connection IDs from <conn> QUIC connection to <cc_conn> */
-static inline void quic_conn_mv_cids_to_cc_conn(struct quic_cc_conn *cc_conn,
+static inline void quic_conn_mv_cids_to_cc_conn(struct quic_conn_closed *cc_conn,
                                                 struct quic_conn *conn)
 {
        struct eb64_node *node;
index 2c43d62d8921b01c7dcebe0f112bf643f87350b6..fe7746fa82d794d769a05d403143dc9a12937e59 100644 (file)
@@ -131,7 +131,7 @@ const struct quic_version *preferred_version;
 const struct quic_version quic_version_VN_reserved = { .num = 0, };
 
 DECLARE_STATIC_POOL(pool_head_quic_conn, "quic_conn", sizeof(struct quic_conn));
-DECLARE_STATIC_POOL(pool_head_quic_cc_conn, "quic_cc_conn", sizeof(struct quic_cc_conn));
+DECLARE_STATIC_POOL(pool_head_quic_conn_closed, "quic_conn_closed", sizeof(struct quic_conn_closed));
 DECLARE_STATIC_POOL(pool_head_quic_cids, "quic_cids", sizeof(struct eb_root));
 DECLARE_POOL(pool_head_quic_connection_id,
              "quic_connection_id", sizeof(struct quic_connection_id));
@@ -324,7 +324,7 @@ int qc_conn_finalize(struct quic_conn *qc, int server)
        return ret;
 }
 
-void qc_cc_err_count_inc(struct quic_conn *qc, struct quic_frame *frm)
+void quic_conn_closed_err_count_inc(struct quic_conn *qc, struct quic_frame *frm)
 {
        TRACE_ENTER(QUIC_EV_CONN_CLOSE, qc);
 
@@ -637,7 +637,7 @@ struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned int sta
        return t;
 }
 
-static void quic_release_cc_conn(struct quic_cc_conn *cc_qc)
+static void quic_release_cc_conn(struct quic_conn_closed *cc_qc)
 {
        struct quic_conn *qc = (struct quic_conn *)cc_qc;
 
@@ -652,15 +652,15 @@ static void quic_release_cc_conn(struct quic_cc_conn *cc_qc)
        pool_free(pool_head_quic_cc_buf, cc_qc->cc_buf_area);
        cc_qc->cc_buf_area = NULL;
        /* free the SSL sock context */
-       pool_free(pool_head_quic_cc_conn, cc_qc);
+       pool_free(pool_head_quic_conn_closed, cc_qc);
 
        TRACE_ENTER(QUIC_EV_CONN_IO_CB);
 }
 
 /* QUIC connection packet handler task used when in "closing connection" state. */
-static struct task *quic_cc_conn_io_cb(struct task *t, void *context, unsigned int state)
+static struct task *quic_conn_closed_io_cb(struct task *t, void *context, unsigned int state)
 {
-       struct quic_cc_conn *cc_qc = context;
+       struct quic_conn_closed *cc_qc = context;
        struct quic_conn *qc = (struct quic_conn *)cc_qc;
        struct buffer buf;
        uint16_t dglen;
@@ -698,9 +698,9 @@ static struct task *quic_cc_conn_io_cb(struct task *t, void *context, unsigned i
 }
 
 /* The task handling the idle timeout of a connection in "connection close" state */
-static struct task *qc_cc_idle_timer_task(struct task *t, void *ctx, unsigned int state)
+static struct task *quic_conn_closed_idle_timer_task(struct task *t, void *ctx, unsigned int state)
 {
-       struct quic_cc_conn *cc_qc = ctx;
+       struct quic_conn_closed *cc_qc = ctx;
 
        quic_release_cc_conn(cc_qc);
 
@@ -713,11 +713,11 @@ static struct task *qc_cc_idle_timer_task(struct task *t, void *ctx, unsigned in
  * connection to the newly allocated connection so that to keep it
  * functional until its idle timer expires.
  */
-static struct quic_cc_conn *qc_new_cc_conn(struct quic_conn *qc)
+static struct quic_conn_closed *qc_new_cc_conn(struct quic_conn *qc)
 {
-       struct quic_cc_conn *cc_qc;
+       struct quic_conn_closed *cc_qc;
 
-       cc_qc = pool_alloc(pool_head_quic_cc_conn);
+       cc_qc = pool_alloc(pool_head_quic_conn_closed);
        if (!cc_qc)
                return NULL;
 
@@ -735,7 +735,7 @@ static struct quic_cc_conn *qc_new_cc_conn(struct quic_conn *qc)
        cc_qc->peer_addr = qc->peer_addr;
 
        cc_qc->wait_event.tasklet = qc->wait_event.tasklet;
-       cc_qc->wait_event.tasklet->process = quic_cc_conn_io_cb;
+       cc_qc->wait_event.tasklet->process = quic_conn_closed_io_cb;
        cc_qc->wait_event.tasklet->context = cc_qc;
        cc_qc->wait_event.events = 0;
        cc_qc->subs = NULL;
@@ -752,7 +752,7 @@ static struct quic_cc_conn *qc_new_cc_conn(struct quic_conn *qc)
        cc_qc->cids = qc->cids;
 
        cc_qc->idle_timer_task = qc->idle_timer_task;
-       cc_qc->idle_timer_task->process = qc_cc_idle_timer_task;
+       cc_qc->idle_timer_task->process = quic_conn_closed_idle_timer_task;
        cc_qc->idle_timer_task->context = cc_qc;
        cc_qc->idle_expire = qc->idle_expire;
 
@@ -1379,7 +1379,7 @@ void quic_conn_release(struct quic_conn *qc)
 {
        struct eb64_node *node;
        struct quic_rx_packet *pkt, *pktback;
-       struct quic_cc_conn *cc_qc;
+       struct quic_conn_closed *cc_qc;
 
        TRACE_ENTER(QUIC_EV_CONN_CLOSE, qc);
 
@@ -1491,7 +1491,7 @@ void quic_conn_release(struct quic_conn *qc)
        qc = NULL;
 
        /* Decrement global counters when quic_conn is deallocated.
-        * quic_cc_conn instances are not accounted as they run for a short
+        * quic_conn_closed instances are not accounted as they run for a short
         * time with limited resources.
         */
        _HA_ATOMIC_DEC(&actconn);
@@ -1881,7 +1881,7 @@ void qc_finalize_affinity_rebind(struct quic_conn *qc)
 
        /* If quic_conn is closing it is unnecessary to migrate it as it will
         * be soon released. Besides, special care must be taken for CLOSING
-        * connections (using quic_cc_conn and th_ctx.quic_conns_clo list for
+        * connections (using quic_conn_closed and th_ctx.quic_conns_clo list for
         * instance). This should never occur as CLOSING connections are
         * skipped by quic_sock_accept_conn().
         */
index 368b2ac01ea70d1b425d76b9b8df3ee55abfe487..e49e6dc95257bd78ed2d9af503dc70da3e94db46 100644 (file)
@@ -1052,7 +1052,7 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,
                case QUIC_FT_CONNECTION_CLOSE:
                case QUIC_FT_CONNECTION_CLOSE_APP:
                        /* Increment the error counters */
-                       qc_cc_err_count_inc(qc, &frm);
+                       quic_conn_closed_err_count_inc(qc, &frm);
                        if (!(qc->flags & QUIC_FL_CONN_DRAINING)) {
                                TRACE_STATE("Entering draining state", QUIC_EV_CONN_PRSHPKT, qc);
                                /* RFC 9000 10.2. Immediate Close: