mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: muxes: Don't expect to call release function with no mux defined
For all muxes, the function responsible to release a mux is always called with a defined mux. Thus there is no reason to test if it is defined or not. Note the patch may seem huge but it is just because of indentation changes.
This commit is contained in:
parent
4e61096e30
commit
4de1bff866
@ -840,15 +840,10 @@ static inline struct fcgi_strm *fcgi_conn_st_by_id(struct fcgi_conn *fconn, int
|
||||
*/
|
||||
static void fcgi_release(struct fcgi_conn *fconn)
|
||||
{
|
||||
struct connection *conn = NULL;
|
||||
struct connection *conn = fconn->conn;
|
||||
|
||||
TRACE_POINT(FCGI_EV_FCONN_END);
|
||||
|
||||
if (fconn) {
|
||||
conn = fconn->conn;
|
||||
|
||||
TRACE_DEVEL("freeing fconn", FCGI_EV_FCONN_END, conn);
|
||||
|
||||
if (LIST_INLIST(&fconn->buf_wait.list))
|
||||
LIST_DEL_INIT(&fconn->buf_wait.list);
|
||||
|
||||
@ -867,7 +862,6 @@ static void fcgi_release(struct fcgi_conn *fconn)
|
||||
&fconn->wait_event);
|
||||
|
||||
pool_free(pool_head_fcgi_conn, fconn);
|
||||
}
|
||||
|
||||
if (conn) {
|
||||
conn->mux = NULL;
|
||||
|
@ -1055,13 +1055,10 @@ static void h1_release(struct h1c *h1c)
|
||||
|
||||
TRACE_POINT(H1_EV_H1C_END);
|
||||
|
||||
if (h1c) {
|
||||
/* The connection must be aattached to this mux to be released */
|
||||
if (h1c->conn && h1c->conn->ctx == h1c)
|
||||
conn = h1c->conn;
|
||||
|
||||
TRACE_DEVEL("freeing h1c", H1_EV_H1C_END, conn);
|
||||
|
||||
if (conn && h1c->flags & H1C_F_UPG_H2C) {
|
||||
TRACE_DEVEL("upgrading H1 to H2", H1_EV_H1C_END, conn);
|
||||
/* Make sure we're no longer subscribed to anything */
|
||||
@ -1103,7 +1100,6 @@ static void h1_release(struct h1c *h1c)
|
||||
|
||||
HA_ATOMIC_DEC(&h1c->px_counters->open_conns);
|
||||
pool_free(pool_head_h1c, h1c);
|
||||
}
|
||||
|
||||
if (conn) {
|
||||
if (!conn_is_back(conn))
|
||||
|
@ -1161,14 +1161,10 @@ static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id)
|
||||
*/
|
||||
static void h2_release(struct h2c *h2c)
|
||||
{
|
||||
struct connection *conn = NULL;
|
||||
struct connection *conn = h2c->conn;
|
||||
|
||||
TRACE_ENTER(H2_EV_H2C_END);
|
||||
|
||||
if (h2c) {
|
||||
conn = h2c->conn;
|
||||
|
||||
TRACE_DEVEL("freeing h2c", H2_EV_H2C_END, conn);
|
||||
hpack_dht_free(h2c->ddht);
|
||||
|
||||
if (LIST_INLIST(&h2c->buf_wait.list))
|
||||
@ -1191,7 +1187,6 @@ static void h2_release(struct h2c *h2c)
|
||||
HA_ATOMIC_DEC(&h2c->px_counters->open_conns);
|
||||
|
||||
pool_free(pool_head_h2c, h2c);
|
||||
}
|
||||
|
||||
if (conn) {
|
||||
if (!conn_is_back(conn))
|
||||
|
@ -200,13 +200,10 @@ static void mux_pt_destroy(struct mux_pt_ctx *ctx)
|
||||
|
||||
TRACE_POINT(PT_EV_CONN_END);
|
||||
|
||||
if (ctx) {
|
||||
/* The connection must be attached to this mux to be released */
|
||||
if (ctx->conn && ctx->conn->ctx == ctx)
|
||||
conn = ctx->conn;
|
||||
|
||||
TRACE_DEVEL("freeing pt context", PT_EV_CONN_END, conn);
|
||||
|
||||
tasklet_free(ctx->wait_event.tasklet);
|
||||
|
||||
if (conn && ctx->wait_event.events != 0)
|
||||
@ -215,7 +212,6 @@ static void mux_pt_destroy(struct mux_pt_ctx *ctx)
|
||||
BUG_ON(ctx->endp && !(ctx->endp->flags & CS_EP_ORPHAN));
|
||||
cs_endpoint_free(ctx->endp);
|
||||
pool_free(pool_head_pt_ctx, ctx);
|
||||
}
|
||||
|
||||
if (conn) {
|
||||
conn->mux = NULL;
|
||||
|
@ -495,16 +495,10 @@ static inline int qcc_may_expire(struct qcc *qcc)
|
||||
*/
|
||||
static void qc_release(struct qcc *qcc)
|
||||
{
|
||||
struct connection *conn = NULL;
|
||||
|
||||
TRACE_ENTER(QMUX_EV_QCC_END);
|
||||
|
||||
if (qcc) {
|
||||
struct connection *conn = qcc->conn;
|
||||
struct eb64_node *node;
|
||||
|
||||
conn = qcc->conn;
|
||||
|
||||
TRACE_DEVEL("freeing qcc", QMUX_EV_QCC_END, conn);
|
||||
TRACE_ENTER(QMUX_EV_QCC_END);
|
||||
|
||||
if (qcc->app_ops && qcc->app_ops->release)
|
||||
qcc->app_ops->release(qcc->ctx);
|
||||
@ -526,7 +520,6 @@ static void qc_release(struct qcc *qcc)
|
||||
}
|
||||
|
||||
pool_free(pool_head_qcc, qcc);
|
||||
}
|
||||
|
||||
if (conn) {
|
||||
LIST_DEL_INIT(&conn->stopping_list);
|
||||
|
Loading…
Reference in New Issue
Block a user