QUIC CHANNEL: Correct timeout calculation for ACKs

ACKs are not restricted by CC so do not consider CC when determining
when we will emit an ACK.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22476)
This commit is contained in:
Hugo Landau 2023-10-23 15:38:16 +01:00 committed by Matt Caswell
parent 82b7a0eee9
commit 4d100bb76a
3 changed files with 20 additions and 22 deletions

View File

@ -2608,26 +2608,24 @@ static OSSL_TIME ch_determine_next_tick_deadline(QUIC_CHANNEL *ch)
deadline = ossl_time_infinite();
/*
* If the CC will let us send acks, check the ack deadline for all
* enc_levels that are actually provisioned
* Check the ack deadline for all enc_levels that are actually provisioned.
* ACKs aren't restricted by CC.
*/
if (ch->cc_method->get_tx_allowance(ch->cc_data) > 0) {
for (i = 0; i < QUIC_ENC_LEVEL_NUM; i++) {
if (ossl_qtx_is_enc_level_provisioned(ch->qtx, i)) {
deadline = ossl_time_min(deadline,
ossl_ackm_get_ack_deadline(ch->ackm,
ossl_quic_enc_level_to_pn_space(i)));
}
for (i = 0; i < QUIC_ENC_LEVEL_NUM; i++) {
if (ossl_qtx_is_enc_level_provisioned(ch->qtx, i)) {
deadline = ossl_time_min(deadline,
ossl_ackm_get_ack_deadline(ch->ackm,
ossl_quic_enc_level_to_pn_space(i)));
}
/*
* When do we need to send an ACK-eliciting packet to reset the idle
* deadline timer for the peer?
*/
if (!ossl_time_is_infinite(ch->ping_deadline))
deadline = ossl_time_min(deadline, ch->ping_deadline);
}
/*
* When do we need to send an ACK-eliciting packet to reset the idle
* deadline timer for the peer?
*/
if (!ossl_time_is_infinite(ch->ping_deadline))
deadline = ossl_time_min(deadline, ch->ping_deadline);
/* Apply TXP wakeup deadline. */
deadline = ossl_time_min(deadline,
ossl_quic_tx_packetiser_get_deadline(ch->txp));

View File

@ -139,9 +139,6 @@ Received Packet
Received Frame: Crypto
Offset: 0
Len: 1022
Received Frame: Crypto
Offset: 1022
Len: 192
Received TLS Record
Header:
Version = TLS 1.2 (0x303)
@ -247,6 +244,9 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk=
------------------
No extensions
Received Frame: Crypto
Offset: 1022
Len: 192
Received TLS Record
Header:
Version = TLS 1.2 (0x303)

View File

@ -137,9 +137,6 @@ Received Packet
Received Frame: Crypto
Offset: 0
Len: 1022
Received Frame: Crypto
Offset: 1022
Len: 192
Received TLS Record
Header:
Version = TLS 1.2 (0x303)
@ -245,6 +242,9 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk=
------------------
No extensions
Received Frame: Crypto
Offset: 1022
Len: 192
Received TLS Record
Header:
Version = TLS 1.2 (0x303)