mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-10 21:22:20 +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:
committed by
Facebook GitHub Bot
parent
19e1c14afd
commit
2176f080ff
@@ -92,7 +92,7 @@ void processServerInitialParams(
|
||||
// TODO Validate active_connection_id_limit
|
||||
|
||||
if (!packetSize || *packetSize == 0) {
|
||||
packetSize = kDefaultMaxUDPPayload;
|
||||
packetSize = kDefaultUDPSendPacketLen;
|
||||
}
|
||||
if (*packetSize < kMinMaxUDPPayload) {
|
||||
throw QuicTransportException(
|
||||
@@ -134,8 +134,10 @@ void processServerInitialParams(
|
||||
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;
|
||||
}
|
||||
|
||||
// Currently no-op for a client; it doesn't issue connection ids
|
||||
|
||||
Reference in New Issue
Block a user