MINOR: quic: redirect app_ops snd_buf through mux
This change is required to be able to use multiple app_ops layer on top
of QUIC. The stream-interface will now call the mux snd_buf which is
just a proxy to the app_ops snd_buf function.
The architecture may be simplified in the structure to install the
app_ops on the stream_interface and avoid the detour via the mux layer
on the sending path.
diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h
index b93a8a5..c05c69c 100644
--- a/include/haproxy/mux_quic-t.h
+++ b/include/haproxy/mux_quic-t.h
@@ -239,6 +239,7 @@
int (*init)(struct qcc *qcc);
int (*attach_ruqs)(struct qcs *qcs, void *ctx);
int (*decode_qcs)(struct qcs *qcs, void *ctx);
+ size_t (*snd_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags);
int (*finalize)(void *ctx);
};
diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h
index 332c529..7f3bd3c 100644
--- a/include/haproxy/mux_quic.h
+++ b/include/haproxy/mux_quic.h
@@ -121,7 +121,5 @@
return bidi_qcs_new(qcc, id);
}
-size_t qc_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags);
-
#endif /* USE_QUIC */
#endif /* _HAPROXY_MUX_QUIC_H */
diff --git a/src/h3.c b/src/h3.c
index 352b8c2..9be2a5b 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -820,5 +820,6 @@
.init = h3_init,
.attach_ruqs = h3_attach_ruqs,
.decode_qcs = h3_decode_qcs,
+ .snd_buf = h3_snd_buf,
.finalize = h3_finalize,
};
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 4903352..d870a68 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -1852,6 +1852,12 @@
return 0;
}
+static size_t qc_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
+{
+ struct qcs *qcs = cs->ctx;
+ return qcs->qcc->app_ops->snd_buf(cs, buf, count, flags);
+}
+
/****************************************/
/* MUX initialization and instantiation */
/***************************************/
@@ -1860,8 +1866,7 @@
static const struct mux_ops qc_ops = {
.init = qc_init,
.wake = qc_wake,
- //.snd_buf = qc_snd_buf,
- .snd_buf = h3_snd_buf,
+ .snd_buf = qc_snd_buf,
.rcv_buf = qc_rcv_buf,
.subscribe = qc_subscribe,
.unsubscribe = qc_unsubscribe,