Small cleanup on snd_buf for application protocol layer.
* do not export h3_snd_buf
* replace stconn by a qcs argument. This is better as h3/hq-interop only
uses the qcs instance.
This should be backported up to 2.6.
extern const struct qcc_app_ops h3_ops;
-size_t h3_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, int flags);
-
#endif /* USE_QUIC */
#endif /* _HAPROXY_H3_T_H */
int (*init)(struct qcc *qcc);
int (*attach)(struct qcs *qcs, void *conn_ctx);
ssize_t (*decode_qcs)(struct qcs *qcs, struct buffer *b, int fin);
- size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags);
+ size_t (*snd_buf)(struct qcs *qcs, struct buffer *buf, size_t count, int flags);
void (*detach)(struct qcs *qcs);
int (*finalize)(void *ctx);
void (*shutdown)(void *ctx); /* Close a connection. */
#include <haproxy/qpack-dec.h>
#include <haproxy/qpack-enc.h>
#include <haproxy/quic_enc.h>
-#include <haproxy/stconn.h>
#include <haproxy/tools.h>
#include <haproxy/trace.h>
#include <haproxy/xprt_quic.h>
return total;
}
-size_t h3_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, int flags)
+static size_t h3_snd_buf(struct qcs *qcs, struct buffer *buf, size_t count, int flags)
{
size_t total = 0;
- struct qcs *qcs = __sc_mux_strm(sc);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
{
struct htx *htx;
struct htx_sl *sl;
- struct stconn *sc;
struct buffer htx_buf = BUF_NULL;
struct ist path;
char *ptr = b_head(b);
htx_add_endof(htx, HTX_BLK_EOH);
htx_to_buf(htx, &htx_buf);
- sc = qc_attach_sc(qcs, &htx_buf);
- if (!sc)
+ if (!qc_attach_sc(qcs, &htx_buf))
return -1;
b_free(&htx_buf);
return &qcs->tx.buf;
}
-static size_t hq_interop_snd_buf(struct stconn *sc, struct buffer *buf,
+static size_t hq_interop_snd_buf(struct qcs *qcs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __sc_mux_strm(sc);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
goto end;
}
- ret = qcs->qcc->app_ops->snd_buf(sc, buf, count, flags);
+ ret = qcs->qcc->app_ops->snd_buf(qcs, buf, count, flags);
end:
TRACE_LEAVE(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);