]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: quic/h3: rename all occurrences of stconn "cs" to "sc"
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 08:09:11 +0000 (10:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
Function arguments and local variables called "cs" were renamed to "sc"
to avoid future confusion. The "nb_cs" stream-connector counter was
renamed to "nb_sc" and qc_attach_cs() was renamed to qc_attach_sc().

include/haproxy/h3.h
include/haproxy/mux_quic-t.h
include/haproxy/mux_quic.h
src/h3.c
src/hq_interop.c
src/mux_quic.c

index b8dfab30bac21a8be266907969bec668d76ac843..7c66714826baf365f16da8e58dc79ddf39fdcdae 100644 (file)
@@ -101,7 +101,7 @@ enum h3s_t {
 
 extern const struct qcc_app_ops h3_ops;
 
-size_t h3_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags);
+size_t h3_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, int flags);
 
 #endif /* USE_QUIC */
 #endif /* _HAPROXY_H3_T_H */
index 99f99702cb4511dc2659fd0c6b66df695e3cf8c7..80fa6832575bac0d5138d816dde773ee6ea3993f 100644 (file)
@@ -32,7 +32,7 @@ enum qcs_type {
 
 struct qcc {
        struct connection *conn;
-       uint64_t nb_cs; /* number of attached stream connectors */
+       uint64_t nb_sc; /* number of attached stream connectors */
        uint32_t flags; /* QC_CF_* */
 
        struct {
@@ -97,7 +97,7 @@ struct qcc {
 #define QC_SF_FIN_RECV          0x00000001  /* last frame received for this stream */
 #define QC_SF_FIN_STREAM        0x00000002  /* FIN bit must be set for last frame of the stream */
 #define QC_SF_BLK_MROOM         0x00000004  /* app layer is blocked waiting for room in the qcs.tx.buf */
-#define QC_SF_DETACH            0x00000008  /* cs is detached but there is remaining data to send */
+#define QC_SF_DETACH            0x00000008  /* sc is detached but there is remaining data to send */
 #define QC_SF_BLK_SFCTL         0x00000010  /* stream blocked due to stream flow control limit */
 #define QC_SF_DEM_FULL          0x00000020  /* demux blocked on request channel buffer full */
 #define QC_SF_READ_ABORTED      0x00000040  /* stream rejected by app layer */
@@ -138,7 +138,7 @@ struct qcc_app_ops {
        int (*init)(struct qcc *qcc);
        int (*attach)(struct qcs *qcs);
        int (*decode_qcs)(struct qcs *qcs, int fin, void *ctx);
-       size_t (*snd_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags);
+       size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags);
        void (*detach)(struct qcs *qcs);
        int (*finalize)(void *ctx);
        int (*is_active)(const struct qcc *qcc, void *ctx);
index bfae337833fdd7c24a66cd7b4a4d928d904bb1ef..9c89c184f7cb730ec1760134667e124722379717 100644 (file)
@@ -91,7 +91,7 @@ static inline int qcc_install_app_ops(struct qcc *qcc,
        return 0;
 }
 
-static inline struct stconn *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
+static inline struct stconn *qc_attach_sc(struct qcs *qcs, struct buffer *buf)
 {
        struct qcc *qcc = qcs->qcc;
        struct session *sess = qcc->conn->owner;
@@ -110,7 +110,7 @@ static inline struct stconn *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
        if (!sc_new_from_endp(qcs->endp, sess, buf))
                return NULL;
 
-       ++qcc->nb_cs;
+       ++qcc->nb_sc;
 
        /* TODO duplicated from mux_h2 */
        sess->accept_date = date;
index cc609f0d2b3f8334af14a505a6eb28fc1ac19600..f30d478ecbd9f12ed5ac2e3fb276283849f9f030 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -341,7 +341,7 @@ static int h3_headers_to_htx(struct qcs *qcs, struct ncbuf *buf, uint64_t len,
        if (fin)
                htx->flags |= HTX_FL_EOM;
 
-       if (!qc_attach_cs(qcs, &htx_buf))
+       if (!qc_attach_sc(qcs, &htx_buf))
                return -1;
 
        /* buffer is transferred to the stream connector and set to NULL
@@ -860,10 +860,10 @@ static int h3_resp_data_send(struct qcs *qcs, struct buffer *buf, size_t count)
        return total;
 }
 
-size_t h3_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
+size_t h3_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, int flags)
 {
        size_t total = 0;
-       struct qcs *qcs = __sc_mux_strm(cs);
+       struct qcs *qcs = __sc_mux_strm(sc);
        struct htx *htx;
        enum htx_blk_type btype;
        struct htx_blk *blk;
index 972ddaf089f567c2e1e81dcf4bf03f0e9e999668..c9ab683901e72e4a506501560a60ff9aad318eea 100644 (file)
@@ -14,7 +14,7 @@ static int hq_interop_decode_qcs(struct qcs *qcs, int fin, void *ctx)
        struct ncbuf *rxbuf = &qcs->rx.ncbuf;
        struct htx *htx;
        struct htx_sl *sl;
-       struct stconn *cs;
+       struct stconn *sc;
        struct buffer htx_buf = BUF_NULL;
        struct ist path;
        char *ptr = ncb_head(rxbuf);
@@ -72,8 +72,8 @@ static int hq_interop_decode_qcs(struct qcs *qcs, int fin, void *ctx)
        htx_add_endof(htx, HTX_BLK_EOH);
        htx_to_buf(htx, &htx_buf);
 
-       cs = qc_attach_cs(qcs, &htx_buf);
-       if (!cs)
+       sc = qc_attach_sc(qcs, &htx_buf);
+       if (!sc)
                return 1;
 
        qcs_consume(qcs, ncb_data(rxbuf, 0));
@@ -93,10 +93,10 @@ static struct buffer *mux_get_buf(struct qcs *qcs)
        return &qcs->tx.buf;
 }
 
-static size_t hq_interop_snd_buf(struct stconn *cs, struct buffer *buf,
+static size_t hq_interop_snd_buf(struct stconn *sc, struct buffer *buf,
                                  size_t count, int flags)
 {
-       struct qcs *qcs = __sc_mux_strm(cs);
+       struct qcs *qcs = __sc_mux_strm(sc);
        struct htx *htx;
        enum htx_blk_type btype;
        struct htx_blk *blk;
index d4256cd98475b74f68871c417f5a5ccb5e1719e9..b1cd313cc39f025c40a3689b5197a753bd3445ec 100644 (file)
@@ -699,7 +699,7 @@ static inline int qcc_is_dead(const struct qcc *qcc)
 /* Return true if the mux timeout should be armed. */
 static inline int qcc_may_expire(struct qcc *qcc)
 {
-       return !qcc->nb_cs;
+       return !qcc->nb_sc;
 }
 
 /* release function. This one should be called to free all resources allocated
@@ -1316,7 +1316,7 @@ static int qc_init(struct connection *conn, struct proxy *prx,
 
        qcc->conn = conn;
        conn->ctx = qcc;
-       qcc->nb_cs = 0;
+       qcc->nb_sc = 0;
        qcc->flags = 0;
 
        qcc->app_ops = NULL;
@@ -1429,7 +1429,7 @@ static void qc_detach(struct sedesc *endp)
 
        TRACE_ENTER(QMUX_EV_STRM_END, qcc->conn, qcs);
 
-       --qcc->nb_cs;
+       --qcc->nb_sc;
 
        if ((b_data(&qcs->tx.buf) || qcs->tx.offset > qcs->tx.sent_offset) &&
            !(qcc->conn->flags & CO_FL_ERROR)) {
@@ -1455,10 +1455,10 @@ static void qc_detach(struct sedesc *endp)
 }
 
 /* Called from the upper layer, to receive data */
-static size_t qc_rcv_buf(struct stconn *cs, struct buffer *buf,
+static size_t qc_rcv_buf(struct stconn *sc, struct buffer *buf,
                          size_t count, int flags)
 {
-       struct qcs *qcs = __sc_mux_strm(cs);
+       struct qcs *qcs = __sc_mux_strm(sc);
        struct htx *qcs_htx = NULL;
        struct htx *cs_htx = NULL;
        size_t ret = 0;
@@ -1525,15 +1525,15 @@ static size_t qc_rcv_buf(struct stconn *cs, struct buffer *buf,
        return ret;
 }
 
-static size_t qc_snd_buf(struct stconn *cs, struct buffer *buf,
+static size_t qc_snd_buf(struct stconn *sc, struct buffer *buf,
                          size_t count, int flags)
 {
-       struct qcs *qcs = __sc_mux_strm(cs);
+       struct qcs *qcs = __sc_mux_strm(sc);
        size_t ret;
 
        TRACE_ENTER(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
 
-       ret = qcs->qcc->app_ops->snd_buf(cs, buf, count, flags);
+       ret = qcs->qcc->app_ops->snd_buf(sc, buf, count, flags);
 
        TRACE_LEAVE(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
 
@@ -1545,19 +1545,19 @@ static size_t qc_snd_buf(struct stconn *cs, struct buffer *buf,
  * as at least one event is still subscribed. The <event_type> must only be a
  * combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0.
  */
-static int qc_subscribe(struct stconn *cs, int event_type,
+static int qc_subscribe(struct stconn *sc, int event_type,
                         struct wait_event *es)
 {
-       return qcs_subscribe(__sc_mux_strm(cs), event_type, es);
+       return qcs_subscribe(__sc_mux_strm(sc), event_type, es);
 }
 
 /* Called from the upper layer, to unsubscribe <es> from events <event_type>.
  * The <es> pointer is not allowed to differ from the one passed to the
  * subscribe() call. It always returns zero.
  */
-static int qc_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
+static int qc_unsubscribe(struct stconn *sc, int event_type, struct wait_event *es)
 {
-       struct qcs *qcs = __sc_mux_strm(cs);
+       struct qcs *qcs = __sc_mux_strm(sc);
 
        BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
        BUG_ON(qcs->subs && qcs->subs != es);