]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC Congestion Control: API to determine deadline at which more credit will be available
authorHugo Landau <hlandau@openssl.org>
Mon, 31 Oct 2022 13:51:09 +0000 (13:51 +0000)
committerHugo Landau <hlandau@openssl.org>
Fri, 13 Jan 2023 13:20:09 +0000 (13:20 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)

doc/designs/quic-design/congestion-control.md
include/internal/quic_cc.h
ssl/quic/cc_dummy.c

index 231d4ef360b770b725f767843c41361221970bc9..7881ca9871692a7328b3545f0dba7a107a3eebf3 100644 (file)
@@ -177,6 +177,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
index 2a702b0731364b7ce2fcad6ce3dd6d2f2e0cd745..f056f0dbeefab2c67b7bfd404607d2148e393037 100644 (file)
@@ -81,6 +81,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
index feeb6cb015c59d9dec9880a9918d7ad7e7af66dc..195c4324bf964daf15e0bb98197afb6f3c05b0b7 100644 (file)
@@ -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,