1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00

Set upper limits on max_packet_size from the peer.

Summary: This will limit us to standard Ethernet MTU (1500) for now, but I think that is fine. This will allow us to experiment with packet size from the client more easily.

Reviewed By: yangchi

Differential Revision: D20709146

fbshipit-source-id: 608463de53d4520a257052491683263e14fc9682
This commit is contained in:
Matt Joras
2020-03-27 17:20:28 -07:00
committed by Facebook GitHub Bot
parent 19e1c14afd
commit 2176f080ff
5 changed files with 25 additions and 11 deletions

View File

@@ -125,7 +125,7 @@ void processClientInitialParams(
// TODO Validate active_connection_id_limit
if (!packetSize || *packetSize == 0) {
packetSize = kDefaultMaxUDPPayload;
packetSize = kDefaultUDPSendPacketLen;
}
if (*packetSize < kMinMaxUDPPayload) {
throw QuicTransportException(
@@ -165,8 +165,10 @@ void processClientInitialParams(
ackDelayExponent.value_or(kDefaultAckDelayExponent);
// TODO: udpSendPacketLen should also be limited by PMTU
if (conn.transportSettings.canIgnorePathMTU) {
conn.udpSendPacketLen =
std::min<uint64_t>(*packetSize, kDefaultMaxUDPPayload);
if (*packetSize > kDefaultMaxUDPPayload) {
*packetSize = kDefaultUDPSendPacketLen;
}
conn.udpSendPacketLen = *packetSize;
}
conn.peerActiveConnectionIdLimit =