int (*wake)(struct connection *conn); /* mux-layer callback to report activity, mandatory */
size_t (*rcv_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
- size_t (*init_fastfwd)(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice); /* Callback to fill the SD iobuf */
+ size_t (*nego_fastfwd)(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice); /* Callback to fill the SD iobuf */
void (*done_fastfwd)(struct stconn *sc); /* Callback to terminate fast data forwarding */
int (*fastfwd)(struct stconn *sc, unsigned int count, unsigned int flags); /* Callback to init fast data forwarding */
int (*resume_fastfwd)(struct stconn *sc, unsigned int flags); /* Callback to resume fast data forwarding */
return (se->iobuf.data + (se->iobuf.pipe ? se->iobuf.pipe->data : 0));
}
-static inline size_t se_init_ff(struct sedesc *se, struct buffer *input, size_t count, unsigned int may_splice)
+static inline size_t se_nego_ff(struct sedesc *se, struct buffer *input, size_t count, unsigned int may_splice)
{
size_t ret = 0;
const struct mux_ops *mux = se->conn->mux;
se->iobuf.flags &= ~IOBUF_FL_FF_BLOCKED;
- if (mux->init_fastfwd && mux->done_fastfwd) {
- ret = mux->init_fastfwd(se->sc, input, count, may_splice);
+ if (mux->nego_fastfwd && mux->done_fastfwd) {
+ ret = mux->nego_fastfwd(se->sc, input, count, may_splice);
if ((se->iobuf.flags & IOBUF_FL_FF_BLOCKED) && !(se->sc->wait_event.events & SUB_RETRY_SEND)) {
/* The SC must be subs for send to be notify when some
* space is made
return sdo;
}
-static size_t h1_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
+static size_t h1_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
{
struct h1s *h1s = __sc_mux_strm(sc);
struct h1c *h1c = h1s->h1c;
if (h1m->state == H1_MSG_DATA && (h1m->flags & (H1_MF_CHNK|H1_MF_CLEN)) && count > h1m->curr_len)
count = h1m->curr_len;
- try = se_init_ff(sdo, &h1c->ibuf, count, !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING));
+ try = se_nego_ff(sdo, &h1c->ibuf, count, !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING));
if (b_room(&h1c->ibuf) && (h1c->flags & H1C_F_IN_FULL)) {
h1c->flags &= ~H1C_F_IN_FULL;
TRACE_STATE("h1c ibuf not full anymore", H1_EV_STRM_RECV|H1_EV_H1C_BLK);
.used_streams = h1_used_streams,
.rcv_buf = h1_rcv_buf,
.snd_buf = h1_snd_buf,
- .init_fastfwd = h1_init_ff,
+ .nego_fastfwd = h1_nego_ff,
.done_fastfwd = h1_done_ff,
.fastfwd = h1_fastfwd,
.resume_fastfwd = h1_resume_fastfwd,
.used_streams = h1_used_streams,
.rcv_buf = h1_rcv_buf,
.snd_buf = h1_snd_buf,
- .init_fastfwd = h1_init_ff,
+ .nego_fastfwd = h1_nego_ff,
.done_fastfwd = h1_done_ff,
.fastfwd = h1_fastfwd,
.resume_fastfwd = h1_resume_fastfwd,
return total;
}
-static size_t h2_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
+static size_t h2_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
{
struct h2s *h2s = __sc_mux_strm(sc);
struct h2c *h2c = h2s->h2c;
.wake = h2_wake,
.snd_buf = h2_snd_buf,
.rcv_buf = h2_rcv_buf,
- .init_fastfwd = h2_init_ff,
+ .nego_fastfwd = h2_nego_ff,
.done_fastfwd = h2_done_ff,
.resume_fastfwd = h2_resume_ff,
.subscribe = h2_subscribe,
return sdo;
}
-static size_t mux_pt_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
+static size_t mux_pt_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice)
{
struct connection *conn = __sc_conn(sc);
struct mux_pt_ctx *ctx = conn->ctx;
goto out;
}
- try = se_init_ff(sdo, &BUF_NULL, count, conn->xprt->rcv_pipe && !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING));
+ try = se_nego_ff(sdo, &BUF_NULL, count, conn->xprt->rcv_pipe && !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING));
if (sdo->iobuf.flags & IOBUF_FL_NO_FF) {
/* Fast forwading is not supported by the consumer */
se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD);
.wake = mux_pt_wake,
.rcv_buf = mux_pt_rcv_buf,
.snd_buf = mux_pt_snd_buf,
- .init_fastfwd = mux_pt_init_ff,
+ .nego_fastfwd = mux_pt_nego_ff,
.done_fastfwd = mux_pt_done_ff,
.fastfwd = mux_pt_fastfwd,
.resume_fastfwd = mux_pt_resume_fastfwd,
.wake = mux_pt_wake,
.rcv_buf = mux_pt_rcv_buf,
.snd_buf = mux_pt_snd_buf,
- .init_fastfwd = mux_pt_init_ff,
+ .nego_fastfwd = mux_pt_nego_ff,
.done_fastfwd = mux_pt_done_ff,
.fastfwd = mux_pt_fastfwd,
.resume_fastfwd = mux_pt_resume_fastfwd,