From: Amaury Denoyelle Date: Mon, 4 Jul 2022 09:42:27 +0000 (+0200) Subject: MINOR: mux-quic: implement accessor for sedesc X-Git-Tag: v2.7-dev2~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3abeb579093c5c9c40b5e95d1ff77a11738fed30;p=thirdparty%2Fhaproxy.git MINOR: mux-quic: implement accessor for sedesc Implement a function 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. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index cb7a09e6e7..8abf1640b3 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -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) {