forked from quic-go/quic-go
send packets with maximum IPv4 and IPv6 packet size
This commit is contained in:
@@ -2,9 +2,11 @@ package protocol
|
||||
|
||||
import "time"
|
||||
|
||||
// MaxPacketSize is the maximum packet size that we use for sending packets.
|
||||
// It includes the QUIC packet header, but excludes the UDP and IP header.
|
||||
const MaxPacketSize ByteCount = 1200
|
||||
// MaxPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets.
|
||||
const MaxPacketSizeIPv4 = 1252
|
||||
|
||||
// MaxPacketSizeIPv6 is the maximum packet size that we use for sending IPv6 packets.
|
||||
const MaxPacketSizeIPv6 = 1232
|
||||
|
||||
// NonForwardSecurePacketSizeReduction is the number of bytes a non forward-secure packet has to be smaller than a forward-secure packet
|
||||
// This makes sure that those packets can always be retransmitted without splitting the contained StreamFrames
|
||||
|
||||
@@ -41,7 +41,7 @@ func ParseGoawayFrame(r *bytes.Reader, _ protocol.VersionNumber) (*GoawayFrame,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if reasonPhraseLen > uint16(protocol.MaxPacketSize) {
|
||||
if reasonPhraseLen > uint16(protocol.MaxReceivePacketSize) {
|
||||
return nil, qerr.Error(qerr.InvalidGoawayData, "reason phrase too long")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user