mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
MEDIUM: connection: make mux->detach() release the connection
For H2, only the mux's timeout or other conditions might cause a release of the mux and the connection, no stream should be allowed to kill such a shared connection. So a stream will only detach using cs_destroy() which will call mux->detach() then free the cs. For now it's only handled by mux_pt. The goal is that the data layer never has to care about the connection, which will have to be released depending on the mux's mood.
This commit is contained in:
parent
a553ae96f5
commit
2c52a2b9ee
@ -694,12 +694,7 @@ static inline void conn_free(struct connection *conn)
|
|||||||
/* Release a conn_stream, and kill the connection if it was the last one */
|
/* Release a conn_stream, and kill the connection if it was the last one */
|
||||||
static inline void cs_destroy(struct conn_stream *cs)
|
static inline void cs_destroy(struct conn_stream *cs)
|
||||||
{
|
{
|
||||||
struct connection *conn = cs->conn;
|
cs->conn->mux->detach(cs);
|
||||||
|
|
||||||
LIST_DEL(&conn->list);
|
|
||||||
conn_stop_tracking(conn);
|
|
||||||
conn_full_close(conn);
|
|
||||||
conn_free(conn);
|
|
||||||
cs_free(cs);
|
cs_free(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,11 +113,16 @@ static struct conn_stream *mux_pt_attach(struct connection *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Detach the stream from the connection
|
* Detach the stream from the connection and possibly release the connection.
|
||||||
* (Used for outgoing connections)
|
|
||||||
*/
|
*/
|
||||||
static void mux_pt_detach(struct conn_stream *cs)
|
static void mux_pt_detach(struct conn_stream *cs)
|
||||||
{
|
{
|
||||||
|
struct connection *conn = cs->conn;
|
||||||
|
|
||||||
|
LIST_DEL(&conn->list);
|
||||||
|
conn_stop_tracking(conn);
|
||||||
|
conn_full_close(conn);
|
||||||
|
conn_free(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mux_pt_shutr(struct conn_stream *cs, enum cs_shr_mode mode)
|
static void mux_pt_shutr(struct conn_stream *cs, enum cs_shr_mode mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user