On stream detach on backend side, connection is inserted in the proper
server/session list to be able to reuse it later. If insertion fails and
the connection is idle, the connection can be removed immediately.
If this occurs on a QUIC connection, QUIC MUX implements graceful
shutdown to ensure the server is notified of the closure. However, the
connection instance is not freed. Change this to ensure that both
shutdown and release is performed.
if (!session_add_conn(sess, conn, conn->target)) {
TRACE_ERROR("error during connection insert into session list", QMUX_EV_STRM_END, conn);
conn->owner = NULL;
- if (!qcc->nb_sc) {
- qcc_shutdown(qcc);
- goto end;
- }
+ if (!qcc->nb_sc)
+ goto release;
}
/* If conn is idle, check if session can keep it. Conn is freed if this is not the case.
if (!srv_add_to_idle_list(objt_server(conn->target), conn, 1)) {
/* Idle conn insert failure, gracefully close the connection. */
TRACE_DEVEL("idle connection cannot be kept on the server", QMUX_EV_STRM_END, conn);
- qcc_shutdown(qcc);
+ goto release;
}
+
goto end;
}
else if (!conn->hash_node->node.node.leaf_p &&