summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_txp.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-03-01 16:52:40 +0000
committerMatt Caswell <matt@openssl.org>2023-05-01 11:03:54 +0100
commit90699176b07469e0b6b688ed88bc3f1deb5ccc26 (patch)
tree44087a2c077d8b1193686b2eb43847fc7460bb63 /ssl/quic/quic_txp.c
parent91d39be797fb248edfe9da9678d05c937b1f88af (diff)
QUIC CC: Major revisions to CC abstract interface
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20423)
Diffstat (limited to 'ssl/quic/quic_txp.c')
-rw-r--r--ssl/quic/quic_txp.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/ssl/quic/quic_txp.c b/ssl/quic/quic_txp.c
index 2d49e64f7f..786d25ecf6 100644
--- a/ssl/quic/quic_txp.c
+++ b/ssl/quic/quic_txp.c
@@ -483,7 +483,8 @@ int ossl_quic_tx_packetiser_has_pending(OSSL_QUIC_TX_PACKETISER *txp,
int cc_can_send;
cc_can_send
- = (bypass_cc || txp->args.cc_method->can_send(txp->args.cc_data));
+ = (bypass_cc
+ || txp->args.cc_method->get_tx_allowance(txp->args.cc_data) > 0);
for (enc_level = QUIC_ENC_LEVEL_INITIAL;
enc_level < QUIC_ENC_LEVEL_NUM;
@@ -512,7 +513,7 @@ int ossl_quic_tx_packetiser_generate(OSSL_QUIC_TX_PACKETISER *txp,
/*
* If CC says we cannot send we still may be able to send any queued probes.
*/
- cc_can_send = txp->args.cc_method->can_send(txp->args.cc_data);
+ cc_can_send = (txp->args.cc_method->get_tx_allowance(txp->args.cc_data) > 0);
for (enc_level = QUIC_ENC_LEVEL_INITIAL;
enc_level < QUIC_ENC_LEVEL_NUM;
@@ -900,15 +901,8 @@ static int txp_generate_for_el(OSSL_QUIC_TX_PACKETISER *txp, uint32_t enc_level,
size_t mdpl, hdr_len, pkt_overhead, cc_limit;
uint64_t cc_limit_;
QUIC_PKT_HDR phdr;
- OSSL_TIME time_since_last;
/* Determine the limit CC imposes on what we can send. */
- if (ossl_time_is_zero(txp->last_tx_time))
- time_since_last = ossl_time_zero();
- else
- time_since_last = ossl_time_subtract(txp->args.now(txp->args.now_arg),
- txp->last_tx_time);
-
if (!cc_can_send) {
/*
* If we are called when we cannot send, this must be because we want
@@ -917,10 +911,7 @@ static int txp_generate_for_el(OSSL_QUIC_TX_PACKETISER *txp, uint32_t enc_level,
cc_limit = SIZE_MAX;
} else {
/* Allow CC to clamp how much we can send. */
- cc_limit_ = txp->args.cc_method->get_send_allowance(txp->args.cc_data,
- time_since_last,
- ossl_time_is_zero(time_since_last));
-
+ cc_limit_ = txp->args.cc_method->get_tx_allowance(txp->args.cc_data);
cc_limit = (cc_limit_ > SIZE_MAX ? SIZE_MAX : (size_t)cc_limit_);
}