diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-11-01 16:39:09 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-01-13 13:20:14 +0000 |
commit | 4ed9e0a1e36eaa8f07a4a5371f9d13912a3f9da8 (patch) | |
tree | f2ce2f3558acd9c4c7842b89d8688a4266cca06d /ssl/quic/quic_ackm.c | |
parent | 27003aa6ebcb9f3a03c253dbd26fc152e1481fab (diff) |
QUIC ACKM: Add function to get PTO
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'ssl/quic/quic_ackm.c')
-rw-r--r-- | ssl/quic/quic_ackm.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ssl/quic/quic_ackm.c b/ssl/quic/quic_ackm.c index 54298b54c4..53eb51cfc8 100644 --- a/ssl/quic/quic_ackm.c +++ b/ssl/quic/quic_ackm.c @@ -1663,3 +1663,19 @@ int ossl_ackm_mark_packet_pseudo_lost(OSSL_ACKM *ackm, ackm_on_pkts_lost(ackm, pkt_space, pkt, /*pseudo=*/1); return 1; } + +OSSL_TIME ossl_ackm_get_pto_duration(OSSL_ACKM *ackm) +{ + OSSL_TIME duration; + OSSL_RTT_INFO rtt; + + ossl_statm_get_rtt_info(ackm->statm, &rtt); + + duration = ossl_time_add(rtt.smoothed_rtt, + ossl_time_max(ossl_time_multiply(rtt.rtt_variance, 4), + ossl_ticks2time(K_GRANULARITY))); + if (!ossl_time_is_infinite(rtt.max_ack_delay)) + duration = ossl_time_add(duration, rtt.max_ack_delay); + + return duration; +} |