Home | History | Annotate | Download | only in quic

Lines Matching refs:txfc

19  * TX Flow Controller (TXFC)
23 int ossl_quic_txfc_init(QUIC_TXFC *txfc, QUIC_TXFC *conn_txfc)
28 txfc->swm = 0;
29 txfc->cwm = 0;
30 txfc->parent = conn_txfc;
31 txfc->has_become_blocked = 0;
35 QUIC_TXFC *ossl_quic_txfc_get_parent(QUIC_TXFC *txfc)
37 return txfc->parent;
40 int ossl_quic_txfc_bump_cwm(QUIC_TXFC *txfc, uint64_t cwm)
42 if (cwm <= txfc->cwm)
45 txfc->cwm = cwm;
49 uint64_t ossl_quic_txfc_get_credit_local(QUIC_TXFC *txfc, uint64_t consumed)
51 assert((txfc->swm + consumed) <= txfc->cwm);
52 return txfc->cwm - (consumed + txfc->swm);
55 uint64_t ossl_quic_txfc_get_credit(QUIC_TXFC *txfc, uint64_t consumed)
59 r = ossl_quic_txfc_get_credit_local(txfc, 0);
61 if (txfc->parent != NULL) {
62 assert(txfc->parent->parent == NULL);
63 conn_r = ossl_quic_txfc_get_credit_local(txfc->parent, consumed);
71 int ossl_quic_txfc_consume_credit_local(QUIC_TXFC *txfc, uint64_t num_bytes)
74 uint64_t credit = ossl_quic_txfc_get_credit_local(txfc, 0);
82 txfc->has_become_blocked = 1;
84 txfc->swm += num_bytes;
88 int ossl_quic_txfc_consume_credit(QUIC_TXFC *txfc, uint64_t num_bytes)
90 int ok = ossl_quic_txfc_consume_credit_local(txfc, num_bytes);
92 if (txfc->parent != NULL) {
93 assert(txfc->parent->parent == NULL);
94 if (!ossl_quic_txfc_consume_credit_local(txfc->parent, num_bytes))
101 int ossl_quic_txfc_has_become_blocked(QUIC_TXFC *txfc, int clear)
103 int r = txfc->has_become_blocked;
106 txfc->has_become_blocked = 0;
111 uint64_t ossl_quic_txfc_get_cwm(QUIC_TXFC *txfc)
113 return txfc->cwm;
116 uint64_t ossl_quic_txfc_get_swm(QUIC_TXFC *txfc)
118 return txfc->swm;