MINOR: quic/mux-quic: abstract stream type in qf_stream frame

This commit is contained in:
Amaury Denoyelle 2025-12-10 10:43:36 +01:00
parent 6629d4aaa1
commit 3417f9b90a
3 changed files with 11 additions and 11 deletions

View file

@ -32,7 +32,6 @@
#include <import/ebtree-t.h>
#include <haproxy/buf-t.h>
#include <haproxy/list.h>
#include <haproxy/quic_stream-t.h>
#include <haproxy/quic_token.h>
extern struct pool_head *pool_head_quic_frame;
@ -170,7 +169,7 @@ struct qf_new_token {
struct qf_stream {
uint64_t id;
struct qc_stream_desc *stream;
void *stream;
/* used only on TX when constructing frames.
* Data cleared when processing ACK related to this STREAM frame.

View file

@ -41,16 +41,16 @@ static inline void qc_stream_desc_send(struct qc_stream_desc *stream,
/* Subscribe for send notification on <stream>. */
static inline void qc_stream_desc_sub_send(struct qc_stream_desc *stream,
void (*cb)(struct qc_stream_desc *s, uint64_t offset, uint64_t len))
void (*cb)(void *ctx, uint64_t offset, uint64_t len))
{
stream->notify_send = cb;
stream->notify_send = (void (*)(struct qc_stream_desc *, uint64_t offset, uint64_t len))cb;
}
/* Subscribe for room notification on <stream>. */
static inline void qc_stream_desc_sub_room(struct qc_stream_desc *stream,
void (*cb)(struct qc_stream_desc *s, uint64_t offset))
void (*cb)(void *ctx, uint64_t offset))
{
stream->notify_room = cb;
stream->notify_room = (void (*)(struct qc_stream_desc *, uint64_t offset))cb;
}
#endif /* USE_QUIC */

View file

@ -37,8 +37,8 @@ DECLARE_TYPED_POOL(pool_head_qcc, "qcc", struct qcc);
DECLARE_TYPED_POOL(pool_head_qcs, "qcs", struct qcs);
DECLARE_STATIC_TYPED_POOL(pool_head_qc_stream_rxbuf, "qc_stream_rxbuf", struct qc_stream_rxbuf);
static void qmux_ctrl_send(struct qc_stream_desc *, uint64_t data, uint64_t offset);
static void qmux_ctrl_room(struct qc_stream_desc *, uint64_t room);
static void qmux_ctrl_send(void *ctx, uint64_t data, uint64_t offset);
static void qmux_ctrl_room(void *ctx, uint64_t room);
int qmux_is_quic(const struct qcc *qcc)
{
@ -614,9 +614,9 @@ static uint64_t qcs_prep_bytes(const struct qcs *qcs)
/* Used as a callback for qc_stream_desc layer to notify about emission of a
* STREAM frame of <data> length starting at <offset>.
*/
static void qmux_ctrl_send(struct qc_stream_desc *stream, uint64_t data, uint64_t offset)
static void qmux_ctrl_send(void *ctx, uint64_t data, uint64_t offset)
{
struct qcs *qcs = stream->ctx;
struct qcs *qcs = ((struct qc_stream_desc *)ctx)->ctx;
struct qcc *qcc = qcs->qcc;
uint64_t diff;
@ -715,8 +715,9 @@ static inline int qcc_bufwnd_full(const struct qcc *qcc)
}
}
static void qmux_ctrl_room(struct qc_stream_desc *stream, uint64_t room)
static void qmux_ctrl_room(void *ctx, uint64_t room)
{
struct qc_stream_desc *stream = ctx;
/* Context is different for active and released streams. */
struct qcc *qcc = !(stream->flags & QC_SD_FL_RELEASE) ?
((struct qcs *)stream->ctx)->qcc : stream->ctx;