MINOR: muxes: Don't handle proto upgrade for muxes not supporting it

Several muxes (h2, fcgi, quic) don't support the protocol upgrade. For these
muxes, there is no reason to have code to support it. Thus in the destroy
callback, there is now a BUG_ON() and the release function is simplified
because the connection is always owned by the mux..
This commit is contained in:
Christopher Faulet 2022-04-14 11:23:50 +02:00
parent 7c452ccbff
commit 4e61096e30
3 changed files with 9 additions and 11 deletions

View File

@ -845,9 +845,7 @@ static void fcgi_release(struct fcgi_conn *fconn)
TRACE_POINT(FCGI_EV_FCONN_END);
if (fconn) {
/* The connection must be attached to this mux to be released */
if (fconn->conn && fconn->conn->ctx == fconn)
conn = fconn->conn;
conn = fconn->conn;
TRACE_DEVEL("freeing fconn", FCGI_EV_FCONN_END, conn);
@ -3576,8 +3574,10 @@ static void fcgi_destroy(void *ctx)
struct fcgi_conn *fconn = ctx;
TRACE_POINT(FCGI_EV_FCONN_END, fconn->conn);
if (eb_is_empty(&fconn->streams_by_id) || fconn->conn->ctx != fconn)
if (eb_is_empty(&fconn->streams_by_id)) {
BUG_ON(fconn->conn->ctx != fconn);
fcgi_release(fconn);
}
}
/*

View File

@ -1166,9 +1166,7 @@ static void h2_release(struct h2c *h2c)
TRACE_ENTER(H2_EV_H2C_END);
if (h2c) {
/* The connection must be aattached to this mux to be released */
if (h2c->conn && h2c->conn->ctx == h2c)
conn = h2c->conn;
conn = h2c->conn;
TRACE_DEVEL("freeing h2c", H2_EV_H2C_END, conn);
hpack_dht_free(h2c->ddht);
@ -4350,8 +4348,10 @@ static void h2_destroy(void *ctx)
struct h2c *h2c = ctx;
TRACE_ENTER(H2_EV_H2C_END, h2c->conn);
if (eb_is_empty(&h2c->streams_by_id) || h2c->conn->ctx != h2c)
if (eb_is_empty(&h2c->streams_by_id)) {
BUG_ON(h2c->conn->ctx != h2c);
h2_release(h2c);
}
TRACE_LEAVE(H2_EV_H2C_END);
}

View File

@ -502,9 +502,7 @@ static void qc_release(struct qcc *qcc)
if (qcc) {
struct eb64_node *node;
/* The connection must be aattached to this mux to be released */
if (qcc->conn && qcc->conn->ctx == qcc)
conn = qcc->conn;
conn = qcc->conn;
TRACE_DEVEL("freeing qcc", QMUX_EV_QCC_END, conn);