Respect canIgnorePMTU transport setting
Summary: Mitigate a regression caused by ignoring this setting.
MODIFY
quic/client/state/ClientStateMachine.cpp
quic/client/state/ClientStateMachine.cpp
@@ -42,6 +42,7 @@ std::unique_ptr<QuicClientConnectionState> undoAllClientStateForRetry(
newConn->originalVersion = conn->originalVersion;
newConn->originalPeerAddress = conn->originalPeerAddress;
newConn->peerAddress = conn->peerAddress;
+ newConn->udpSendPacketLen = conn->udpSendPacketLen;
newConn->peerMaxPacketSize = conn->peerMaxPacketSize;
newConn->currentPMTU = conn->currentPMTU;
newConn->supportedVersions = conn->supportedVersions;
@@ -152,10 +153,14 @@ void processServerInitialParams(
}
conn.peerAckDelayExponent =
ackDelayExponent.value_or(kDefaultAckDelayExponent);
+
+ // TODO: udpSendPacketLen should also be limited by PMTU
+ if (conn.transportSettings.canIgnorePathMTU) {
if (*packetSize > kDefaultMaxUDPPayload) {
*packetSize = kDefaultUDPSendPacketLen;
}
updateUdpSendPacketLen(conn, *packetSize);
+ }
// Currently no-op for a client; it doesn't issue connection ids
// to the server.
@@ -233,7 +238,7 @@ void updateTransportParamsFromCachedEarlyParams(
const CachedServerTransportParameters& transportParams) {
conn.peerIdleTimeout = std::chrono::milliseconds(transportParams.idleTimeout);
if (conn.transportSettings.canIgnorePathMTU) {
- conn.peerMaxPacketSize = transportParams.maxRecvPacketSize;
+ updateUdpSendPacketLen(conn, transportParams.maxRecvPacketSize);
}
conn.flowControlState.peerAdvertisedMaxOffset =
transportParams.initialMaxData;

MODIFY
quic/server/state/ServerStateMachine.cpp
quic/server/state/ServerStateMachine.cpp
@@ -176,10 +176,13 @@ void processClientInitialParams(
}
conn.peerAckDelayExponent =
ackDelayExponent.value_or(kDefaultAckDelayExponent);
+ // TODO: udpSendPacketLen should also be limited by PMTU
+ if (conn.transportSettings.canIgnorePathMTU) {
if (*packetSize > kDefaultMaxUDPPayload) {
*packetSize = kDefaultUDPSendPacketLen;
}
updateUdpSendPacketLen(conn, *packetSize);
+ }
conn.peerActiveConnectionIdLimit =
activeConnectionIdLimit.value_or(kDefaultActiveConnectionIdLimit);

Respect canIgnorePMTU transport setting

Summary: Mitigate a regression caused by ignoring this setting.

Reviewed By: mjoras, lnicco

Differential Revision: D23267566

fbshipit-source-id: dc93116c0dab21c9070a4245c4e4eb9dcd9d2de1