MINOR: h3: add h3c pointer into h3s instance
As a mirror to qcc/qcs types, add a h3c pointer into h3s struct. This
should help to clean up H3 code and avoid to use qcs.qcc.ctx to retrieve
the h3c instance.
diff --git a/src/h3.c b/src/h3.c
index 1b8e378..b9a9fed 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -133,6 +133,8 @@
#define H3_SF_UNI_NO_H3 0x00000002 /* unidirectional stream does not carry H3 frames */
struct h3s {
+ struct h3c *h3c;
+
enum h3s_t type;
int demux_frame_len;
int demux_frame_type;
@@ -574,11 +576,11 @@
*
* Returns 0 on success else non-zero.
*/
-static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
+static int h3_decode_qcs(struct qcs *qcs, int fin)
{
struct ncbuf *rxbuf = &qcs->rx.ncbuf;
- struct h3c *h3c = ctx;
struct h3s *h3s = qcs->ctx;
+ struct h3c *h3c = h3s->h3c;
ssize_t ret;
h3_debug_printf(stderr, "%s: STREAM ID: %lu\n", __func__, qcs->id);
@@ -1020,7 +1022,7 @@
return total;
}
-static int h3_attach(struct qcs *qcs)
+static int h3_attach(struct qcs *qcs, void *conn_ctx)
{
struct h3s *h3s;
@@ -1031,6 +1033,8 @@
return 1;
qcs->ctx = h3s;
+ h3s->h3c = conn_ctx;
+
h3s->demux_frame_len = 0;
h3s->demux_frame_type = 0;
h3s->flags = 0;