Skip to content

Commit d225625

Browse files
committed
chore: update quic-go to 0.55.0
1 parent 40e0813 commit d225625

File tree

13 files changed

+115
-104
lines changed

13 files changed

+115
-104
lines changed

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ require (
2424
github.com/metacubex/fswatch v0.1.1
2525
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759
2626
github.com/metacubex/kcp-go v0.0.0-20250923001605-1ba6f691c45b
27-
github.com/metacubex/quic-go v0.54.1-0.20250926001022-e2a3ce003b3a
27+
github.com/metacubex/quic-go v0.55.1-0.20251004050223-450bd9e32033
2828
github.com/metacubex/randv2 v0.2.0
2929
github.com/metacubex/restls-client-go v0.1.7
3030
github.com/metacubex/sing v0.5.6
3131
github.com/metacubex/sing-mux v0.3.4
32-
github.com/metacubex/sing-quic v0.0.0-20250909002258-06122df8f231
32+
github.com/metacubex/sing-quic v0.0.0-20251004051927-c45ee18473bb
3333
github.com/metacubex/sing-shadowsocks v0.2.12
3434
github.com/metacubex/sing-shadowsocks2 v0.2.7
3535
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2
@@ -105,7 +105,6 @@ require (
105105
github.com/vishvananda/netns v0.0.4 // indirect
106106
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
107107
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
108-
go.uber.org/mock v0.4.0 // indirect
109108
golang.org/x/mod v0.20.0 // indirect
110109
golang.org/x/text v0.22.0 // indirect
111110
golang.org/x/time v0.7.0 // indirect

go.sum

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ github.com/metacubex/kcp-go v0.0.0-20250923001605-1ba6f691c45b h1:z7JLKjugnQ1qvD
112112
github.com/metacubex/kcp-go v0.0.0-20250923001605-1ba6f691c45b/go.mod h1:HIJZW4QMhbBqXuqC1ly6Hn0TEYT2SzRw58ns1yGhXTs=
113113
github.com/metacubex/nftables v0.0.0-20250503052935-30a69ab87793 h1:1Qpuy+sU3DmyX9HwI+CrBT/oLNJngvBorR2RbajJcqo=
114114
github.com/metacubex/nftables v0.0.0-20250503052935-30a69ab87793/go.mod h1:RjRNb4G52yAgfR+Oe/kp9G4PJJ97Fnj89eY1BFO3YyA=
115-
github.com/metacubex/quic-go v0.54.1-0.20250926001022-e2a3ce003b3a h1:l7BWjOifmqM2zMi+AMrgIx1z4KJt0oY/6cHW11kA9IQ=
116-
github.com/metacubex/quic-go v0.54.1-0.20250926001022-e2a3ce003b3a/go.mod h1:1lktQFtCD17FZliVypbrDHwbsFSsmz2xz2TRXydvB5c=
115+
github.com/metacubex/quic-go v0.55.1-0.20251004050223-450bd9e32033 h1:LEzvR5AmHEatqE6IWgMBUJHnaiz9VJfZeDGOiHFuWZU=
116+
github.com/metacubex/quic-go v0.55.1-0.20251004050223-450bd9e32033/go.mod h1:1lktQFtCD17FZliVypbrDHwbsFSsmz2xz2TRXydvB5c=
117117
github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs=
118118
github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY=
119119
github.com/metacubex/restls-client-go v0.1.7 h1:eCwiXCTQb5WJu9IlgYvDBA1OgrINv58dEe7hcN5H15k=
@@ -123,8 +123,8 @@ github.com/metacubex/sing v0.5.6 h1:mEPDCadsCj3DB8gn+t/EtposlYuALEkExa/LUguw6/c=
123123
github.com/metacubex/sing v0.5.6/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
124124
github.com/metacubex/sing-mux v0.3.4 h1:tf4r27CIkzaxq9kBlAXQkgMXq2HPp5Mta60Kb4RCZF0=
125125
github.com/metacubex/sing-mux v0.3.4/go.mod h1:SEJfAuykNj/ozbPqngEYqyggwSr81+L7Nu09NRD5mh4=
126-
github.com/metacubex/sing-quic v0.0.0-20250909002258-06122df8f231 h1:dGvo7UahC/gYBQNBoictr14baJzBjAKUAorP63QFFtg=
127-
github.com/metacubex/sing-quic v0.0.0-20250909002258-06122df8f231/go.mod h1:B60FxaPHjR1SeQB0IiLrgwgvKsaoASfOWdiqhLjmMGA=
126+
github.com/metacubex/sing-quic v0.0.0-20251004051927-c45ee18473bb h1:gxrJmnxuEAel+kh3V7ntqkHjURif0xKDu76nzr/BF5Y=
127+
github.com/metacubex/sing-quic v0.0.0-20251004051927-c45ee18473bb/go.mod h1:JK4+PYUKps6pnlicKjsSUAjAcvIUjhorIjdNZGg930M=
128128
github.com/metacubex/sing-shadowsocks v0.2.12 h1:Wqzo8bYXrK5aWqxu/TjlTnYZzAKtKsaFQBdr6IHFaBE=
129129
github.com/metacubex/sing-shadowsocks v0.2.12/go.mod h1:2e5EIaw0rxKrm1YTRmiMnDulwbGxH9hAFlrwQLQMQkU=
130130
github.com/metacubex/sing-shadowsocks2 v0.2.7 h1:hSuuc0YpsfiqYqt1o+fP4m34BQz4e6wVj3PPBVhor3A=
@@ -219,7 +219,6 @@ gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAo
219219
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
220220
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
221221
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
222-
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
223222
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
224223
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
225224
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

transport/hysteria/congestion/brutal.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package congestion
22

33
import (
44
"github.com/metacubex/quic-go/congestion"
5+
"github.com/metacubex/quic-go/monotime"
6+
57
"time"
68
)
79

@@ -47,11 +49,11 @@ func (b *BrutalSender) SetRTTStatsProvider(rttStats congestion.RTTStatsProvider)
4749
b.rttStats = rttStats
4850
}
4951

50-
func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) time.Time {
52+
func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) monotime.Time {
5153
return b.pacer.TimeUntilSend()
5254
}
5355

54-
func (b *BrutalSender) HasPacingBudget(now time.Time) bool {
56+
func (b *BrutalSender) HasPacingBudget(now monotime.Time) bool {
5557
return b.pacer.Budget(now) >= b.maxDatagramSize
5658
}
5759

@@ -67,13 +69,13 @@ func (b *BrutalSender) GetCongestionWindow() congestion.ByteCount {
6769
return congestion.ByteCount(float64(b.bps) * rtt.Seconds() * 1.5 / b.ackRate)
6870
}
6971

70-
func (b *BrutalSender) OnPacketSent(sentTime time.Time, bytesInFlight congestion.ByteCount,
72+
func (b *BrutalSender) OnPacketSent(sentTime monotime.Time, bytesInFlight congestion.ByteCount,
7173
packetNumber congestion.PacketNumber, bytes congestion.ByteCount, isRetransmittable bool) {
7274
b.pacer.SentPacket(sentTime, bytes)
7375
}
7476

7577
func (b *BrutalSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes congestion.ByteCount,
76-
priorInFlight congestion.ByteCount, eventTime time.Time) {
78+
priorInFlight congestion.ByteCount, eventTime monotime.Time) {
7779
// Stub
7880
}
7981

@@ -82,8 +84,8 @@ func (b *BrutalSender) OnCongestionEvent(number congestion.PacketNumber, lostByt
8284
// Stub
8385
}
8486

85-
func (b *BrutalSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime time.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
86-
currentTimestamp := eventTime.Unix()
87+
func (b *BrutalSender) OnCongestionEventEx(priorInFlight congestion.ByteCount, eventTime monotime.Time, ackedPackets []congestion.AckedPacketInfo, lostPackets []congestion.LostPacketInfo) {
88+
currentTimestamp := int64(eventTime)
8789
slot := currentTimestamp % pktInfoSlotCount
8890
if b.pktInfoSlots[slot].Timestamp == currentTimestamp {
8991
b.pktInfoSlots[slot].LossCount += uint64(len(lostPackets))

transport/hysteria/congestion/pacer.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package congestion
22

33
import (
44
"github.com/metacubex/quic-go/congestion"
5+
"github.com/metacubex/quic-go/monotime"
6+
57
"math"
68
"time"
79
)
@@ -15,7 +17,7 @@ const (
1517
type pacer struct {
1618
budgetAtLastSent congestion.ByteCount
1719
maxDatagramSize congestion.ByteCount
18-
lastSentTime time.Time
20+
lastSentTime monotime.Time
1921
getBandwidth func() congestion.ByteCount // in bytes/s
2022
}
2123

@@ -28,7 +30,7 @@ func newPacer(getBandwidth func() congestion.ByteCount) *pacer {
2830
return p
2931
}
3032

31-
func (p *pacer) SentPacket(sendTime time.Time, size congestion.ByteCount) {
33+
func (p *pacer) SentPacket(sendTime monotime.Time, size congestion.ByteCount) {
3234
budget := p.Budget(sendTime)
3335
if size > budget {
3436
p.budgetAtLastSent = 0
@@ -38,7 +40,7 @@ func (p *pacer) SentPacket(sendTime time.Time, size congestion.ByteCount) {
3840
p.lastSentTime = sendTime
3941
}
4042

41-
func (p *pacer) Budget(now time.Time) congestion.ByteCount {
43+
func (p *pacer) Budget(now monotime.Time) congestion.ByteCount {
4244
if p.lastSentTime.IsZero() {
4345
return p.maxBurstSize()
4446
}
@@ -54,10 +56,10 @@ func (p *pacer) maxBurstSize() congestion.ByteCount {
5456
}
5557

5658
// TimeUntilSend returns when the next packet should be sent.
57-
// It returns the zero value of time.Time if a packet can be sent immediately.
58-
func (p *pacer) TimeUntilSend() time.Time {
59+
// It returns the zero value of monotime.Time if a packet can be sent immediately.
60+
func (p *pacer) TimeUntilSend() monotime.Time {
5961
if p.budgetAtLastSent >= p.maxDatagramSize {
60-
return time.Time{}
62+
return monotime.Time(0)
6163
}
6264
return p.lastSentTime.Add(maxDuration(
6365
minPacingDelay,

transport/tuic/congestion/bandwidth_sampler.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"time"
66

77
"github.com/metacubex/quic-go/congestion"
8+
"github.com/metacubex/quic-go/monotime"
89
)
910

1011
var (
@@ -36,18 +37,18 @@ type SendTimeState struct {
3637
type ConnectionStateOnSentPacket struct {
3738
packetNumber congestion.PacketNumber
3839
// Time at which the packet is sent.
39-
sendTime time.Time
40+
sendTime monotime.Time
4041
// Size of the packet.
4142
size congestion.ByteCount
4243
// The value of |totalBytesSentAtLastAckedPacket| at the time the
4344
// packet was sent.
4445
totalBytesSentAtLastAckedPacket congestion.ByteCount
4546
// The value of |lastAckedPacketSentTime| at the time the packet was
4647
// sent.
47-
lastAckedPacketSentTime time.Time
48+
lastAckedPacketSentTime monotime.Time
4849
// The value of |lastAckedPacketAckTime| at the time the packet was
4950
// sent.
50-
lastAckedPacketAckTime time.Time
51+
lastAckedPacketAckTime monotime.Time
5152
// Send time states that are returned to the congestion controller when the
5253
// packet is acked or lost.
5354
sendTimeState SendTimeState
@@ -166,9 +167,9 @@ type BandwidthSampler struct {
166167
totalBytesSentAtLastAckedPacket congestion.ByteCount
167168
// The time at which the last acknowledged packet was sent. Set to
168169
// QuicTime::Zero() if no valid timestamp is available.
169-
lastAckedPacketSentTime time.Time
170+
lastAckedPacketSentTime monotime.Time
170171
// The time at which the most recent packet was acknowledged.
171-
lastAckedPacketAckTime time.Time
172+
lastAckedPacketAckTime monotime.Time
172173
// The most recently sent packet.
173174
lastSendPacket congestion.PacketNumber
174175
// Indicates whether the bandwidth sampler is currently in an app-limited
@@ -194,7 +195,7 @@ func NewBandwidthSampler() *BandwidthSampler {
194195
// packets are sent in order. The information about the packet will not be
195196
// released from the sampler until it the packet is either acknowledged or
196197
// declared lost.
197-
func (s *BandwidthSampler) OnPacketSent(sentTime time.Time, lastSentPacket congestion.PacketNumber, sentBytes, bytesInFlight congestion.ByteCount, hasRetransmittableData bool) {
198+
func (s *BandwidthSampler) OnPacketSent(sentTime monotime.Time, lastSentPacket congestion.PacketNumber, sentBytes, bytesInFlight congestion.ByteCount, hasRetransmittableData bool) {
198199
s.lastSendPacket = lastSentPacket
199200

200201
if !hasRetransmittableData {
@@ -224,7 +225,7 @@ func (s *BandwidthSampler) OnPacketSent(sentTime time.Time, lastSentPacket conge
224225
// OnPacketAcked Notifies the sampler that the |lastAckedPacket| is acknowledged. Returns a
225226
// bandwidth sample. If no bandwidth sample is available,
226227
// QuicBandwidth::Zero() is returned.
227-
func (s *BandwidthSampler) OnPacketAcked(ackTime time.Time, lastAckedPacket congestion.PacketNumber) *BandwidthSample {
228+
func (s *BandwidthSampler) OnPacketAcked(ackTime monotime.Time, lastAckedPacket congestion.PacketNumber) *BandwidthSample {
228229
sentPacketState := s.connectionStats.Get(lastAckedPacket)
229230
if sentPacketState == nil {
230231
return NewBandwidthSample()
@@ -238,7 +239,7 @@ func (s *BandwidthSampler) OnPacketAcked(ackTime time.Time, lastAckedPacket cong
238239

239240
// onPacketAckedInner Handles the actual bandwidth calculations, whereas the outer method handles
240241
// retrieving and removing |sentPacket|.
241-
func (s *BandwidthSampler) onPacketAckedInner(ackTime time.Time, lastAckedPacket congestion.PacketNumber, sentPacket *ConnectionStateOnSentPacket) *BandwidthSample {
242+
func (s *BandwidthSampler) onPacketAckedInner(ackTime monotime.Time, lastAckedPacket congestion.PacketNumber, sentPacket *ConnectionStateOnSentPacket) *BandwidthSample {
242243
s.totalBytesAcked += sentPacket.size
243244

244245
s.totalBytesSentAtLastAckedPacket = sentPacket.sendTimeState.totalBytesSent
@@ -336,7 +337,7 @@ type ConnectionStates struct {
336337
stats map[congestion.PacketNumber]*ConnectionStateOnSentPacket
337338
}
338339

339-
func (s *ConnectionStates) Insert(packetNumber congestion.PacketNumber, sentTime time.Time, bytes congestion.ByteCount, sampler *BandwidthSampler) bool {
340+
func (s *ConnectionStates) Insert(packetNumber congestion.PacketNumber, sentTime monotime.Time, bytes congestion.ByteCount, sampler *BandwidthSampler) bool {
340341
if _, ok := s.stats[packetNumber]; ok {
341342
return false
342343
}
@@ -357,7 +358,7 @@ func (s *ConnectionStates) Remove(packetNumber congestion.PacketNumber) (bool, *
357358
return ok, state
358359
}
359360

360-
func NewConnectionStateOnSentPacket(packetNumber congestion.PacketNumber, sentTime time.Time, bytes congestion.ByteCount, sampler *BandwidthSampler) *ConnectionStateOnSentPacket {
361+
func NewConnectionStateOnSentPacket(packetNumber congestion.PacketNumber, sentTime monotime.Time, bytes congestion.ByteCount, sampler *BandwidthSampler) *ConnectionStateOnSentPacket {
361362
return &ConnectionStateOnSentPacket{
362363
packetNumber: packetNumber,
363364
sendTime: sentTime,

0 commit comments

Comments
 (0)