]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: implement accessor for sedesc
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 4 Jul 2022 09:42:27 +0000 (11:42 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 5 Jul 2022 09:22:15 +0000 (11:22 +0200)
Implement a function <qcs_sc> to easily access to the stconn associated
with a QCS. This takes care of qcs.sd which may be NULL, for example for
unidirectional streams.

It is expected that in the future when implementing
STOP_SENDING/RESET_STREAM, stconn must be notify about the event. This
accessor will allow to easily test if the stconn is instantiated or not.

src/mux_quic.c

index cb7a09e6e72fcd11aebcce17016601096377d8e3..8abf1640b343fdb22d48f76bd2c3a4c0cbe333bc 100644 (file)
@@ -221,6 +221,11 @@ void qcs_free(struct qcs *qcs)
        pool_free(pool_head_qcs, qcs);
 }
 
+static forceinline struct stconn *qcs_sc(const struct qcs *qcs)
+{
+       return qcs->sd ? qcs->sd->sc : NULL;
+}
+
 struct buffer *qc_get_buf(struct qcs *qcs, struct buffer *bptr)
 {
        struct buffer *buf = b_alloc(bptr);
@@ -1615,7 +1620,7 @@ static int qc_wake_some_streams(struct qcc *qcc)
             node = eb64_next(node)) {
                qcs = eb64_entry(node, struct qcs, by_id);
 
-               if (!qcs->sd || !qcs->sd->sc)
+               if (!qcs_sc(qcs))
                        continue;
 
                if (qcc->conn->flags & CO_FL_ERROR) {