mirror of
https://github.com/SagerNet/sing-quic.git
synced 2025-04-03 20:07:39 +03:00
Update quic-go to v0.45.1
This commit is contained in:
parent
500b9c0eeb
commit
fb5f112475
11 changed files with 46 additions and 78 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/quic-go/congestion"
|
||||
|
@ -14,27 +13,12 @@ import (
|
|||
|
||||
const (
|
||||
// InitialMaxDatagramSize is the default maximum packet size used in QUIC for congestion window computations in bytes.
|
||||
InitialMaxDatagramSize = 1252
|
||||
InitialPacketSizeIPv4 = 1252
|
||||
InitialPacketSizeIPv6 = 1232
|
||||
InitialMaxDatagramSize = 1280
|
||||
InitialPacketSize = 1280
|
||||
InitialCongestionWindow = 32
|
||||
DefaultBBRMaxCongestionWindow = 10000
|
||||
)
|
||||
|
||||
func GetInitialPacketSize(addr net.Addr) congestion.ByteCount {
|
||||
maxSize := congestion.ByteCount(1200)
|
||||
// If this is not a UDP address, we don't know anything about the MTU.
|
||||
// Use the minimum size of an Initial packet as the max packet size.
|
||||
if udpAddr, ok := addr.(*net.UDPAddr); ok {
|
||||
if udpAddr.IP.To4() != nil {
|
||||
maxSize = InitialPacketSizeIPv4
|
||||
} else {
|
||||
maxSize = InitialPacketSizeIPv6
|
||||
}
|
||||
}
|
||||
return congestion.ByteCount(maxSize)
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
// Default initial rtt used before any samples are received.
|
||||
|
|
|
@ -21,7 +21,7 @@ const (
|
|||
cubeCongestionWindowScale = 410
|
||||
cubeFactor congestion.ByteCount = 1 << cubeScale / cubeCongestionWindowScale / maxDatagramSize
|
||||
// TODO: when re-enabling cubic, make sure to use the actual packet size here
|
||||
maxDatagramSize = congestion.ByteCount(InitialPacketSizeIPv4)
|
||||
maxDatagramSize = congestion.ByteCount(congestion.InitialPacketSizeIPv4)
|
||||
)
|
||||
|
||||
const defaultNumConnections = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue