MINOR: mux-quic: implement accessor for sedesc
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.
diff --git a/src/mux_quic.c b/src/mux_quic.c
index cb7a09e..8abf164 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -221,6 +221,11 @@
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 @@
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) {