CLEANUP: mux-quic: rename the "endp" field to "sd"
The stream endpoint descriptor that was named "endp" is now called "sd" both in the qcs struct and in the few functions using this.
This commit is contained in:
parent
92c2e93b0e
commit
d7b7e0df9a
|
@ -104,7 +104,7 @@ struct qcc {
|
||||||
|
|
||||||
struct qcs {
|
struct qcs {
|
||||||
struct qcc *qcc;
|
struct qcc *qcc;
|
||||||
struct sedesc *endp;
|
struct sedesc *sd;
|
||||||
uint32_t flags; /* QC_SF_* */
|
uint32_t flags; /* QC_SF_* */
|
||||||
void *ctx; /* app-ops context */
|
void *ctx; /* app-ops context */
|
||||||
|
|
||||||
|
|
|
@ -96,18 +96,18 @@ static inline struct stconn *qc_attach_sc(struct qcs *qcs, struct buffer *buf)
|
||||||
struct qcc *qcc = qcs->qcc;
|
struct qcc *qcc = qcs->qcc;
|
||||||
struct session *sess = qcc->conn->owner;
|
struct session *sess = qcc->conn->owner;
|
||||||
|
|
||||||
qcs->endp = sedesc_new();
|
qcs->sd = sedesc_new();
|
||||||
if (!qcs->endp)
|
if (!qcs->sd)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
qcs->endp->se = qcs;
|
qcs->sd->se = qcs;
|
||||||
qcs->endp->conn = qcc->conn;
|
qcs->sd->conn = qcc->conn;
|
||||||
se_fl_set(qcs->endp, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
|
se_fl_set(qcs->sd, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
|
||||||
|
|
||||||
/* TODO duplicated from mux_h2 */
|
/* TODO duplicated from mux_h2 */
|
||||||
sess->t_idle = tv_ms_elapsed(&sess->tv_accept, &now) - sess->t_handshake;
|
sess->t_idle = tv_ms_elapsed(&sess->tv_accept, &now) - sess->t_handshake;
|
||||||
|
|
||||||
if (!sc_new_from_endp(qcs->endp, sess, buf))
|
if (!sc_new_from_endp(qcs->sd, sess, buf))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
++qcc->nb_sc;
|
++qcc->nb_sc;
|
||||||
|
@ -118,7 +118,7 @@ static inline struct stconn *qc_attach_sc(struct qcs *qcs, struct buffer *buf)
|
||||||
sess->t_handshake = 0;
|
sess->t_handshake = 0;
|
||||||
sess->t_idle = 0;
|
sess->t_idle = 0;
|
||||||
|
|
||||||
return qcs->endp->sc;
|
return qcs->sd->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_QUIC */
|
#endif /* USE_QUIC */
|
||||||
|
|
|
@ -124,7 +124,7 @@ struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type)
|
||||||
|
|
||||||
qcs->stream = NULL;
|
qcs->stream = NULL;
|
||||||
qcs->qcc = qcc;
|
qcs->qcc = qcc;
|
||||||
qcs->endp = NULL;
|
qcs->sd = NULL;
|
||||||
qcs->flags = QC_SF_NONE;
|
qcs->flags = QC_SF_NONE;
|
||||||
qcs->ctx = NULL;
|
qcs->ctx = NULL;
|
||||||
|
|
||||||
|
@ -213,8 +213,8 @@ void qcs_free(struct qcs *qcs)
|
||||||
|
|
||||||
qc_stream_desc_release(qcs->stream);
|
qc_stream_desc_release(qcs->stream);
|
||||||
|
|
||||||
BUG_ON(qcs->endp && !se_fl_test(qcs->endp, SE_FL_ORPHAN));
|
BUG_ON(qcs->sd && !se_fl_test(qcs->sd, SE_FL_ORPHAN));
|
||||||
sedesc_free(qcs->endp);
|
sedesc_free(qcs->sd);
|
||||||
|
|
||||||
eb64_delete(&qcs->by_id);
|
eb64_delete(&qcs->by_id);
|
||||||
pool_free(pool_head_qcs, qcs);
|
pool_free(pool_head_qcs, qcs);
|
||||||
|
@ -1422,9 +1422,9 @@ static void qc_destroy(void *ctx)
|
||||||
TRACE_LEAVE(QMUX_EV_QCC_END);
|
TRACE_LEAVE(QMUX_EV_QCC_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qc_detach(struct sedesc *endp)
|
static void qc_detach(struct sedesc *sd)
|
||||||
{
|
{
|
||||||
struct qcs *qcs = endp->se;
|
struct qcs *qcs = sd->se;
|
||||||
struct qcc *qcc = qcs->qcc;
|
struct qcc *qcc = qcs->qcc;
|
||||||
|
|
||||||
TRACE_ENTER(QMUX_EV_STRM_END, qcc->conn, qcs);
|
TRACE_ENTER(QMUX_EV_STRM_END, qcc->conn, qcs);
|
||||||
|
@ -1499,15 +1499,15 @@ static size_t qc_rcv_buf(struct stconn *sc, struct buffer *buf,
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (b_data(&qcs->rx.app_buf)) {
|
if (b_data(&qcs->rx.app_buf)) {
|
||||||
se_fl_set(qcs->endp, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
|
se_fl_set(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
se_fl_clr(qcs->endp, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
|
se_fl_clr(qcs->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
|
||||||
if (se_fl_test(qcs->endp, SE_FL_ERR_PENDING))
|
if (se_fl_test(qcs->sd, SE_FL_ERR_PENDING))
|
||||||
se_fl_set(qcs->endp, SE_FL_ERROR);
|
se_fl_set(qcs->sd, SE_FL_ERROR);
|
||||||
|
|
||||||
if (fin)
|
if (fin)
|
||||||
se_fl_set(qcs->endp, SE_FL_EOI);
|
se_fl_set(qcs->sd, SE_FL_EOI);
|
||||||
|
|
||||||
if (b_size(&qcs->rx.app_buf)) {
|
if (b_size(&qcs->rx.app_buf)) {
|
||||||
b_free(&qcs->rx.app_buf);
|
b_free(&qcs->rx.app_buf);
|
||||||
|
@ -1582,20 +1582,20 @@ static int qc_wake_some_streams(struct qcc *qcc)
|
||||||
node = eb64_next(node)) {
|
node = eb64_next(node)) {
|
||||||
qcs = eb64_entry(node, struct qcs, by_id);
|
qcs = eb64_entry(node, struct qcs, by_id);
|
||||||
|
|
||||||
if (!qcs->endp || !qcs->endp->sc)
|
if (!qcs->sd || !qcs->sd->sc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (qcc->conn->flags & CO_FL_ERROR) {
|
if (qcc->conn->flags & CO_FL_ERROR) {
|
||||||
se_fl_set(qcs->endp, SE_FL_ERR_PENDING);
|
se_fl_set(qcs->sd, SE_FL_ERR_PENDING);
|
||||||
if (se_fl_test(qcs->endp, SE_FL_EOS))
|
if (se_fl_test(qcs->sd, SE_FL_EOS))
|
||||||
se_fl_set(qcs->endp, SE_FL_ERROR);
|
se_fl_set(qcs->sd, SE_FL_ERROR);
|
||||||
|
|
||||||
if (qcs->subs) {
|
if (qcs->subs) {
|
||||||
qcs_notify_recv(qcs);
|
qcs_notify_recv(qcs);
|
||||||
qcs_notify_send(qcs);
|
qcs_notify_send(qcs);
|
||||||
}
|
}
|
||||||
else if (qcs->endp->sc->app_ops->wake) {
|
else if (qcs->sd->sc->app_ops->wake) {
|
||||||
qcs->endp->sc->app_ops->wake(qcs->endp->sc);
|
qcs->sd->sc->app_ops->wake(qcs->sd->sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue