CLEANUP: quic/h3: rename all occurrences of stconn "cs" to "sc"
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().
diff --git a/include/haproxy/h3.h b/include/haproxy/h3.h
index b8dfab3..7c66714 100644
--- a/include/haproxy/h3.h
+++ b/include/haproxy/h3.h
@@ -101,7 +101,7 @@
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 */
diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h
index 99f9970..80fa683 100644
--- a/include/haproxy/mux_quic-t.h
+++ b/include/haproxy/mux_quic-t.h
@@ -32,7 +32,7 @@
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 @@
#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 @@
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);
diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h
index bfae337..9c89c18 100644
--- a/include/haproxy/mux_quic.h
+++ b/include/haproxy/mux_quic.h
@@ -91,7 +91,7 @@
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 @@
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;
diff --git a/src/h3.c b/src/h3.c
index cc609f0..f30d478 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -341,7 +341,7 @@
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 @@
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;
diff --git a/src/hq_interop.c b/src/hq_interop.c
index 972ddaf..c9ab683 100644
--- a/src/hq_interop.c
+++ b/src/hq_interop.c
@@ -14,7 +14,7 @@
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 @@
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 @@
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;
diff --git a/src/mux_quic.c b/src/mux_quic.c
index d4256cd..b1cd313 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -699,7 +699,7 @@
/* 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 @@
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 @@
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 @@
}
/* 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 @@
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 @@
* 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);