Skip to content

Commit b2567df

Browse files
authored
Merge pull request #1347 from apernet/bump-quic
feat: quic-go v0.51.0
2 parents 16c7ebe + c2c4a95 commit b2567df

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

app/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/apernet/hysteria/app/v2
22

3-
go 1.22
3+
go 1.23
44

5-
toolchain go1.23.2
5+
toolchain go1.24.2
66

77
require (
88
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f
@@ -30,7 +30,7 @@ require (
3030

3131
require (
3232
github.com/andybalholm/brotli v1.1.0 // indirect
33-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 // indirect
33+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a // indirect
3434
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect
3535
github.com/cloudflare/circl v1.3.9 // indirect
3636
github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect

app/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1
4242
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
4343
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY=
4444
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM=
45-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI=
46-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o=
45+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois=
46+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ=
4747
github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0=
4848
github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk=
4949
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
@@ -485,8 +485,6 @@ golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
485485
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
486486
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
487487
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
488-
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
489-
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
490488
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
491489
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
492490
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

core/client/client.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package client
33
import (
44
"context"
55
"crypto/tls"
6+
"errors"
67
"net"
78
"net/http"
89
"net/url"
@@ -221,18 +222,21 @@ func (c *clientImpl) Close() error {
221222
return nil
222223
}
223224

225+
var nonPermanentErrors = []error{
226+
quic.StreamLimitReachedError{},
227+
}
228+
224229
// wrapIfConnectionClosed checks if the error returned by quic-go
225-
// indicates that the QUIC connection has been permanently closed,
226-
// and if so, wraps the error with coreErrs.ClosedError.
227-
// PITFALL: sometimes quic-go has "internal errors" that are not net.Error,
228-
// but we still need to treat them as ClosedError.
230+
// is recoverable (listed in nonPermanentErrors) or permanent.
231+
// Recoverable errors are returned as-is,
232+
// permanent ones are wrapped as ClosedError.
229233
func wrapIfConnectionClosed(err error) error {
230-
netErr, ok := err.(net.Error)
231-
if !ok || !netErr.Temporary() {
232-
return coreErrs.ClosedError{Err: err}
233-
} else {
234-
return err
234+
for _, e := range nonPermanentErrors {
235+
if errors.Is(err, e) {
236+
return err
237+
}
235238
}
239+
return coreErrs.ClosedError{Err: err}
236240
}
237241

238242
type tcpConn struct {

core/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/apernet/hysteria/core/v2
22

3-
go 1.22
3+
go 1.23
44

5-
toolchain go1.23.2
5+
toolchain go1.24.2
66

77
require (
8-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0
8+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a
99
github.com/stretchr/testify v1.9.0
1010
go.uber.org/goleak v1.2.1
1111
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842

core/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI=
2-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o=
1+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois=
2+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ=
33
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
44
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
55
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=

extras/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/apernet/hysteria/extras/v2
22

3-
go 1.22
3+
go 1.23
44

5-
toolchain go1.23.2
5+
toolchain go1.24.2
66

77
require (
88
github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000
9-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0
9+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a
1010
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6
1111
github.com/database64128/tfo-go/v2 v2.2.2
1212
github.com/hashicorp/golang-lru/v2 v2.0.5

extras/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
22
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
3-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0 h1:oc6//C91pY9gGOBioHeyJrmmpKv/nS8fvTeDpKNPLnI=
4-
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0/go.mod h1:/mMPNt1MHqduzaVB2qFHnJwam3BR5r5b35GvYouJs/o=
3+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a h1:3UksCgxkac5L2hSbs3rZZVIOSX0EMQEg3K0HtTCoois=
4+
github.com/apernet/quic-go v0.51.1-0.20250420212127-ede9b032759a/go.mod h1:I/47OIGG5H/IfAm+nz2c6hm6b/NkEhpvptAoiPcY7jQ=
55
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
66
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg=
77
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -107,8 +107,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
107107
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
108108
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
109109
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
110-
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
111-
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
112110
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
113111
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
114112
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

go.work

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
go 1.22
1+
go 1.23
22

3-
toolchain go1.23.2
3+
toolchain go1.24.2
44

55
use (
66
./app

0 commit comments

Comments
 (0)