h2s->st = H2_SS_CLOSED;
}
-/* detaches an H2 stream from its H2C. */
-static void h2s_detach(struct h2s *h2s)
+/* detaches an H2 stream from its H2C and releases it to the H2S pool. */
+static void h2s_destroy(struct h2s *h2s)
{
h2s_close(h2s);
LIST_DEL(&h2s->list);
LIST_INIT(&h2s->list);
eb32_delete(&h2s->by_id);
-}
-
-/* releases an H2 stream back to the pool, and detaches it from the h2c. */
-static void h2s_free(struct h2s *h2s)
-{
pool_free(pool_head_h2s, h2s);
}
out_free_cs:
cs_free(cs);
out_close:
- h2s_detach(h2s);
- h2s_free(h2s);
+ h2s_destroy(h2s);
h2s = NULL;
out:
return h2s;
if (!h2s->cs) {
/* this stream was already orphaned */
- h2s_detach(h2s);
- h2s_free(h2s);
+ h2s_destroy(h2s);
continue;
}
h2s->cs->flags &= ~CS_FL_DATA_WR_ENA;
else {
/* just sent the last frame for this orphaned stream */
- h2s_detach(h2s);
- h2s_free(h2s);
+ h2s_destroy(h2s);
}
}
}
h2s->cs->flags &= ~CS_FL_DATA_WR_ENA;
else {
/* just sent the last frame for this orphaned stream */
- h2s_detach(h2s);
- h2s_free(h2s);
+ h2s_destroy(h2s);
}
}
}
conn_xprt_want_send(cs->conn);
}
- h2s_detach(h2s);
- h2s_free(h2s);
+ h2s_destroy(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