mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-07-30 14:43:05 +03:00
Cache the negotiated config for ACKs once the transport parameters are received
Summary: Cache the negotiated config for what ACK type to write and which fields to use once the peer transport parameters are available. This avoids computing the config with every ack frame being written. Reviewed By: sharmafb Differential Revision: D70004436 fbshipit-source-id: 79354f5137c77353c3a97d4c41782a700622e986
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c6d8f76e67
commit
7f65f36b62
@ -2131,4 +2131,35 @@ void maybeScheduleAckForCongestionFeedback(
|
||||
}
|
||||
}
|
||||
|
||||
void updateNegotiatedAckFeatures(QuicConnectionStateBase& conn) {
|
||||
bool isAckReceiveTimestampsSupported =
|
||||
conn.transportSettings.maybeAckReceiveTimestampsConfigSentToPeer &&
|
||||
conn.maybePeerAckReceiveTimestampsConfig;
|
||||
|
||||
uint64_t peerRequestedTimestampsCount =
|
||||
conn.maybePeerAckReceiveTimestampsConfig.has_value()
|
||||
? conn.maybePeerAckReceiveTimestampsConfig.value()
|
||||
.maxReceiveTimestampsPerAck
|
||||
: 0;
|
||||
|
||||
conn.negotiatedAckReceiveTimestampSupport =
|
||||
isAckReceiveTimestampsSupported && (peerRequestedTimestampsCount > 0);
|
||||
|
||||
conn.negotiatedExtendedAckFeatures = conn.peerAdvertisedExtendedAckFeatures &
|
||||
conn.transportSettings.enableExtendedAckFeatures;
|
||||
// Disable the ECN fields if we are not reading them
|
||||
if (!conn.transportSettings.readEcnOnIngress) {
|
||||
conn.negotiatedExtendedAckFeatures &=
|
||||
~static_cast<ExtendedAckFeatureMaskType>(
|
||||
ExtendedAckFeatureMask::ECN_COUNTS);
|
||||
}
|
||||
// Disable the receive timestamps fields if we have not regoatiated receive
|
||||
// timestamps support
|
||||
if (!conn.negotiatedAckReceiveTimestampSupport) {
|
||||
conn.negotiatedExtendedAckFeatures &=
|
||||
~static_cast<ExtendedAckFeatureMaskType>(
|
||||
ExtendedAckFeatureMask::RECEIVE_TIMESTAMPS);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace quic
|
||||
|
Reference in New Issue
Block a user