mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: h2: always call h2s_detach() in h2_detach()
The code is safer and more robust this way, it avoids multiple paths. This is possible due to the idempotence of LIST_DEL() and eb32_delete() that are called in h2s_detach().
This commit is contained in:
parent
4a333d3d53
commit
e323f3458c
@ -2455,10 +2455,6 @@ static void h2_detach(struct conn_stream *cs)
|
||||
if (h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL))
|
||||
return;
|
||||
|
||||
/* the stream could be in the send list */
|
||||
LIST_DEL(&h2s->list);
|
||||
LIST_INIT(&h2s->list);
|
||||
|
||||
if ((h2c->flags & H2_CF_DEM_BLOCK_ANY && h2s->id == h2c->dsi) ||
|
||||
(h2c->flags & H2_CF_MUX_BLOCK_ANY && h2s->id == h2c->msi)) {
|
||||
/* unblock the connection if it was blocked on this
|
||||
@ -2470,9 +2466,8 @@ static void h2_detach(struct conn_stream *cs)
|
||||
conn_xprt_want_send(cs->conn);
|
||||
}
|
||||
|
||||
if (h2s->by_id.node.leaf_p) {
|
||||
/* h2s still attached to the h2c */
|
||||
h2s_detach(h2s);
|
||||
h2s_free(h2s);
|
||||
|
||||
/* We don't want to close right now unless we're removing the
|
||||
* last stream, and either the connection is in error, or it
|
||||
@ -2497,8 +2492,6 @@ static void h2_detach(struct conn_stream *cs)
|
||||
h2c->task->expire = TICK_ETERNITY;
|
||||
}
|
||||
}
|
||||
h2s_free(h2s);
|
||||
}
|
||||
|
||||
static void h2_shutr(struct conn_stream *cs, enum cs_shr_mode mode)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user