summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-10-31 13:51:09 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:09 +0000
commit97c5c52d6c2c5d13db0cc59b3dbf4d75c40ec3ba (patch)
tree9cad3fc57d901099e32568946b9dfa4aa59d5744
parente5d575686efb280af08c3fd307a649ed2a942ce3 (diff)
QUIC Congestion Control: API to determine deadline at which more credit will be available
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
-rw-r--r--doc/designs/quic-design/congestion-control.md6
-rw-r--r--include/internal/quic_cc.h6
-rw-r--r--ssl/quic/cc_dummy.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/doc/designs/quic-design/congestion-control.md b/doc/designs/quic-design/congestion-control.md
index 231d4ef360..7881ca9871 100644
--- a/doc/designs/quic-design/congestion-control.md
+++ b/doc/designs/quic-design/congestion-control.md
@@ -178,6 +178,12 @@ struct ossl_cc_method_st {
size_t (*get_bytes_in_flight_max)(OSSL_CC_DATA *ccdata);
/*
+ * Returns the time at which the CC will next release more budget
+ * for sending, or ossl_time_infinite().
+ */
+ OSSL_TIME (*get_next_credit_time)(OSSL_CC_DATA *ccdata);
+
+ /*
* To be called when a packet with retransmittable data was sent.
* |num_retransmittable_bytes| is the number of bytes sent
* in the packet that are retransmittable.
diff --git a/include/internal/quic_cc.h b/include/internal/quic_cc.h
index 2a702b0731..f056f0dbee 100644
--- a/include/internal/quic_cc.h
+++ b/include/internal/quic_cc.h
@@ -82,6 +82,12 @@ typedef struct ossl_cc_method_st {
uint64_t (*get_bytes_in_flight_max)(OSSL_CC_DATA *ccdata);
/*
+ * Returns the time at which the CC will next release more budget
+ * for sending, or ossl_time_infinite().
+ */
+ OSSL_TIME (*get_next_credit_time)(OSSL_CC_DATA *ccdata);
+
+ /*
* To be called when a packet with retransmittable data was sent.
* |num_retransmittable_bytes| is the number of bytes sent
* in the packet that are retransmittable.
diff --git a/ssl/quic/cc_dummy.c b/ssl/quic/cc_dummy.c
index feeb6cb015..195c4324bf 100644
--- a/ssl/quic/cc_dummy.c
+++ b/ssl/quic/cc_dummy.c
@@ -56,6 +56,11 @@ static uint64_t dummy_get_bytes_in_flight_max(OSSL_CC_DATA *cc)
return SIZE_MAX;
}
+static OSSL_TIME dummy_get_next_credit_time(OSSL_CC_DATA *cc_data)
+{
+ return ossl_time_infinite();
+}
+
static int dummy_on_data_sent(OSSL_CC_DATA *cc,
uint64_t num_retransmittable_bytes)
{
@@ -99,6 +104,7 @@ const OSSL_CC_METHOD ossl_cc_dummy_method = {
dummy_can_send,
dummy_get_send_allowance,
dummy_get_bytes_in_flight_max,
+ dummy_get_next_credit_time,
dummy_on_data_sent,
dummy_on_data_invalidated,
dummy_on_data_acked,