From: Amaury Denoyelle Date: Wed, 22 Sep 2021 12:48:32 +0000 (+0200) Subject: MEDIUM: quic: implement mux release/conn free X-Git-Tag: v2.5-dev8~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd28b275815544e684de76b328a3b9be13141663;p=thirdparty%2Fhaproxy.git MEDIUM: quic: implement mux release/conn free --- diff --git a/src/mux_quic.c b/src/mux_quic.c index f17ccd2063..1c8669d3e6 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1029,7 +1029,9 @@ struct qcs *luqs_new(struct qcc *qcc) qcs->subs = NULL; LIST_INIT(&qcs->list); - eb64_insert(&qcc->streams_by_id, &qcs->by_id); + // TODO do not insert luqs into streams_by_id as it prevent to detect + // that the connection is dead + //eb64_insert(&qcc->streams_by_id, &qcs->by_id); TRACE_LEAVE(QC_EV_QCS_NEW, qcc->conn); return qcs; @@ -1071,7 +1073,9 @@ struct qcs *ruqs_new(struct qcc *qcc, uint64_t id) qcs->subs = NULL; LIST_INIT(&qcs->list); - eb64_insert(&qcc->streams_by_id, &qcs->by_id); + // TODO do not insert ruqs into streams_by_id as it prevent to detect + // that the connection is dead + //eb64_insert(&qcc->streams_by_id, &qcs->by_id); TRACE_LEAVE(QC_EV_QCS_NEW, qcc->conn); return qcs; @@ -1595,9 +1599,12 @@ static void qc_destroy(void *ctx) static void qc_detach(struct conn_stream *cs) { struct qcs *qcs = cs->ctx; + struct qcc *qcc = qcs->qcc; TRACE_ENTER(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL, qcs); - /* XXX TO DO XXX */ + qcs_destroy(qcs); + if (eb_is_empty(&qcc->streams_by_id)) + qc_release(qcc); TRACE_LEAVE(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL); }