chore: limit tuicv5's maxUdpRelayPacketSize up to 1200-PacketOverHead

This commit is contained in:
wwqgtxx
2023-09-21 23:49:45 +08:00
parent 7f49c91267
commit 4fe7a463c5
4 changed files with 15 additions and 1 deletions

View File

@ -223,6 +223,10 @@ func NewServer(option *ServerOption, pc net.PacketConn) (*Server, error) {
}
}
if len(option.Users) > 0 {
maxUdpRelayPacketSize := option.MaxUdpRelayPacketSize
if maxUdpRelayPacketSize > MaxFragSizeV5 {
maxUdpRelayPacketSize = MaxFragSizeV5
}
server.optionV5 = &v5.ServerOption{
HandleTcpFn: option.HandleTcpFn,
HandleUdpFn: option.HandleUdpFn,