REORG: stconn/muxes: Rename init step in fast-forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Oct 2023 10:18:10 +0000 (12:18 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Oct 2023 10:46:55 +0000 (12:46 +0200)
Instead of speaking of an initialisation stage for each data
fast-forwarding, we now use the negociate term. Thus init_ff/init_fastfwd
functions were renamed nego_ff/nego_fastfwd.

include/haproxy/connection-t.h
include/haproxy/stconn.h
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c

index f6edc30..cf1a4cb 100644 (file)
@@ -423,7 +423,7 @@ struct mux_ops {
        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 */
index 71338ad..71751f6 100644 (file)
@@ -132,7 +132,7 @@ static inline size_t se_ff_data(struct sedesc *se)
        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;
 
@@ -140,8 +140,8 @@ static inline size_t se_init_ff(struct sedesc *se, struct buffer *input, size_t
                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
index 87bc0e4..7dc424e 100644 (file)
@@ -4390,7 +4390,7 @@ static inline struct sedesc *h1s_opposite_sd(struct h1s *h1s)
        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;
@@ -4584,7 +4584,7 @@ static int h1_fastfwd(struct stconn *sc, unsigned int count, unsigned int flags)
        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);
@@ -5185,7 +5185,7 @@ static const struct mux_ops mux_http_ops = {
        .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,
@@ -5212,7 +5212,7 @@ static const struct mux_ops mux_h1_ops = {
        .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,
index 35b440e..9acca45 100644 (file)
@@ -6872,7 +6872,7 @@ static size_t h2_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in
        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;
@@ -7372,7 +7372,7 @@ static const struct mux_ops h2_ops = {
        .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,
index 4b50fcd..52a5527 100644 (file)
@@ -579,7 +579,7 @@ static inline struct sedesc *mux_pt_opposite_sd(struct mux_pt_ctx *ctx)
        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;
@@ -661,7 +661,7 @@ static int mux_pt_fastfwd(struct stconn *sc, unsigned int count, unsigned int fl
                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);
@@ -800,7 +800,7 @@ const struct mux_ops mux_tcp_ops = {
        .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,
@@ -825,7 +825,7 @@ const struct mux_ops mux_pt_ops = {
        .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,