BUG/MEDIUM: h2: Don't forget to empty the wait lists on destroy.

Empty both send_list and fctl_list when destroying the h2 context, so that
if we're freeing the stream after, it doesn't try to remove itself from the
now-deleted list.

No backport is needed.
This commit is contained in:
Olivier Houchard 2018-09-12 17:52:46 +02:00 committed by Willy Tarreau
parent 175a2bb507
commit 251f6a23ad

View File

@ -491,6 +491,19 @@ static void h2_release(struct connection *conn)
tasklet_free(h2c->wait_list.task);
LIST_DEL(&h2c->wait_list.list);
LIST_INIT(&h2c->wait_list.list);
while (!LIST_ISEMPTY(&h2c->send_list)) {
struct wait_list *sw = LIST_ELEM(h2c->send_list.n,
struct wait_list *, list);
LIST_DEL(&sw->list);
LIST_INIT(&sw->list);
}
while (!LIST_ISEMPTY(&h2c->fctl_list)) {
struct wait_list *sw = LIST_ELEM(h2c->fctl_list.n,
struct wait_list *, list);
LIST_DEL(&sw->list);
LIST_INIT(&sw->list);
}
pool_free(pool_head_h2c, h2c);
}