From c64b36b8f4308407b177ad749ae887d250db2971 Mon Sep 17 00:00:00 2001 From: Toby Date: Mon, 31 Jul 2023 17:27:23 -0700 Subject: [PATCH] feat: update to quic-go v0.37.1, module renamed to github.com/apernet/quic-go --- app/go.mod | 7 ++----- app/go.sum | 10 ++++------ core/client/client.go | 6 +++--- core/client/udp.go | 3 ++- core/go.mod | 7 ++----- core/go.sum | 10 ++++------ core/internal/congestion/brutal.go | 2 +- core/internal/congestion/pacer.go | 2 +- core/internal/integration_tests/masq_test.go | 4 ++-- core/internal/protocol/proxy.go | 2 +- core/internal/utils/qstream.go | 2 +- core/server/server.go | 6 +++--- core/server/udp.go | 2 +- extras/go.mod | 7 ++----- extras/go.sum | 10 ++++------ 15 files changed, 33 insertions(+), 47 deletions(-) diff --git a/app/go.mod b/app/go.mod index b033f9cda6..47944ab4f1 100644 --- a/app/go.mod +++ b/app/go.mod @@ -15,6 +15,7 @@ require ( ) require ( + github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect @@ -33,9 +34,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/qtls-go1-19 v0.3.2 // indirect - github.com/quic-go/qtls-go1-20 v0.2.2 // indirect - github.com/quic-go/quic-go v0.0.0-00010101000000-000000000000 // indirect + github.com/quic-go/qtls-go1-20 v0.3.0 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -57,8 +56,6 @@ require ( rsc.io/qr v0.2.0 // indirect ) -replace github.com/quic-go/quic-go => github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d - replace github.com/apernet/hysteria/core => ../core replace github.com/apernet/hysteria/extras => ../extras diff --git a/app/go.sum b/app/go.sum index 0abd857169..965ff7975c 100644 --- a/app/go.sum +++ b/app/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d h1:Yp2jez75QOlxae26CzyY3pmZzqRf/6C7b/DD8PSegPw= -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d/go.mod h1:zPetvwDlILVxt15n3hr3Gf/I3mDf7LpLKPhR4Ez0AZQ= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c h1:kl+p4uqk9sc/A9D0rgQ4IQxWMRVa3nSUFpvJ8/IQhe0= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c/go.mod h1:tKbqlrErvfl0qmDz6L0qpAGEZ/WduGkn4lwNTT7HyXg= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/caddyserver/certmagic v0.17.2 h1:o30seC1T/dBqBCNNGNHWwj2i5/I/FMjBbTAhjADP3nE= @@ -179,10 +179,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U= -github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= -github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E= -github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/qtls-go1-20 v0.3.0 h1:NrCXmDl8BddZwO67vlvEpBTwT89bJfKYygxv4HQvuDk= +github.com/quic-go/qtls-go1-20 v0.3.0/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/core/client/client.go b/core/client/client.go index b269c4d337..7ed6a78c97 100644 --- a/core/client/client.go +++ b/core/client/client.go @@ -13,8 +13,8 @@ import ( "github.com/apernet/hysteria/core/internal/protocol" "github.com/apernet/hysteria/core/internal/utils" - "github.com/quic-go/quic-go" - "github.com/quic-go/quic-go/http3" + "github.com/apernet/quic-go" + "github.com/apernet/quic-go/http3" ) const ( @@ -270,7 +270,7 @@ type udpIOImpl struct { func (io *udpIOImpl) ReceiveMessage() (*protocol.UDPMessage, error) { for { - msg, err := io.Conn.ReceiveMessage() + msg, err := io.Conn.ReceiveMessage(context.Background()) if err != nil { // Connection error, this will stop the session manager return nil, err diff --git a/core/client/udp.go b/core/client/udp.go index 57dbaa4186..2dc567e9db 100644 --- a/core/client/udp.go +++ b/core/client/udp.go @@ -6,10 +6,11 @@ import ( "math/rand" "sync" + "github.com/apernet/quic-go" + coreErrs "github.com/apernet/hysteria/core/errors" "github.com/apernet/hysteria/core/internal/frag" "github.com/apernet/hysteria/core/internal/protocol" - "github.com/quic-go/quic-go" ) const ( diff --git a/core/go.mod b/core/go.mod index e4e2b1f7ef..2b120e2b06 100644 --- a/core/go.mod +++ b/core/go.mod @@ -3,7 +3,7 @@ module github.com/apernet/hysteria/core go 1.20 require ( - github.com/quic-go/quic-go v0.0.0-00010101000000-000000000000 + github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c github.com/stretchr/testify v1.8.4 go.uber.org/goleak v1.2.1 golang.org/x/time v0.3.0 @@ -19,8 +19,7 @@ require ( github.com/onsi/ginkgo/v2 v2.9.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/qtls-go1-19 v0.3.2 // indirect - github.com/quic-go/qtls-go1-20 v0.2.2 // indirect + github.com/quic-go/qtls-go1-20 v0.3.0 // indirect github.com/stretchr/objx v0.5.0 // indirect golang.org/x/crypto v0.4.0 // indirect golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect @@ -33,5 +32,3 @@ require ( gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/quic-go/quic-go => github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d diff --git a/core/go.sum b/core/go.sum index d52885f6dd..840ba8ccf9 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d h1:Yp2jez75QOlxae26CzyY3pmZzqRf/6C7b/DD8PSegPw= -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d/go.mod h1:zPetvwDlILVxt15n3hr3Gf/I3mDf7LpLKPhR4Ez0AZQ= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c h1:kl+p4uqk9sc/A9D0rgQ4IQxWMRVa3nSUFpvJ8/IQhe0= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c/go.mod h1:tKbqlrErvfl0qmDz6L0qpAGEZ/WduGkn4lwNTT7HyXg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -32,10 +32,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U= -github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= -github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E= -github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/qtls-go1-20 v0.3.0 h1:NrCXmDl8BddZwO67vlvEpBTwT89bJfKYygxv4HQvuDk= +github.com/quic-go/qtls-go1-20 v0.3.0/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= diff --git a/core/internal/congestion/brutal.go b/core/internal/congestion/brutal.go index 7b9d1d7f0a..c5aba50e1f 100644 --- a/core/internal/congestion/brutal.go +++ b/core/internal/congestion/brutal.go @@ -3,7 +3,7 @@ package congestion import ( "time" - "github.com/quic-go/quic-go/congestion" + "github.com/apernet/quic-go/congestion" ) const ( diff --git a/core/internal/congestion/pacer.go b/core/internal/congestion/pacer.go index 5e5521e385..80e3675f22 100644 --- a/core/internal/congestion/pacer.go +++ b/core/internal/congestion/pacer.go @@ -4,7 +4,7 @@ import ( "math" "time" - "github.com/quic-go/quic-go/congestion" + "github.com/apernet/quic-go/congestion" ) const ( diff --git a/core/internal/integration_tests/masq_test.go b/core/internal/integration_tests/masq_test.go index 894baf0dfb..e507da9699 100644 --- a/core/internal/integration_tests/masq_test.go +++ b/core/internal/integration_tests/masq_test.go @@ -16,8 +16,8 @@ import ( "github.com/apernet/hysteria/core/internal/protocol" "github.com/apernet/hysteria/core/server" - "github.com/quic-go/quic-go" - "github.com/quic-go/quic-go/http3" + "github.com/apernet/quic-go" + "github.com/apernet/quic-go/http3" ) // TestServerMasquerade is a test to ensure that the server behaves as a normal diff --git a/core/internal/protocol/proxy.go b/core/internal/protocol/proxy.go index dc36229448..19f52f2e64 100644 --- a/core/internal/protocol/proxy.go +++ b/core/internal/protocol/proxy.go @@ -8,7 +8,7 @@ import ( "github.com/apernet/hysteria/core/errors" - "github.com/quic-go/quic-go/quicvarint" + "github.com/apernet/quic-go/quicvarint" ) const ( diff --git a/core/internal/utils/qstream.go b/core/internal/utils/qstream.go index 6325b337e2..a3a4833caa 100644 --- a/core/internal/utils/qstream.go +++ b/core/internal/utils/qstream.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/quic-go/quic-go" + "github.com/apernet/quic-go" ) // QStream is a wrapper of quic.Stream that handles Close() in a way that diff --git a/core/server/server.go b/core/server/server.go index 93d3d4aaf9..202892e2d2 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -6,8 +6,8 @@ import ( "net/http" "sync" - "github.com/quic-go/quic-go" - "github.com/quic-go/quic-go/http3" + "github.com/apernet/quic-go" + "github.com/apernet/quic-go/http3" "github.com/apernet/hysteria/core/internal/congestion" "github.com/apernet/hysteria/core/internal/protocol" @@ -238,7 +238,7 @@ type udpIOImpl struct { func (io *udpIOImpl) ReceiveMessage() (*protocol.UDPMessage, error) { for { - msg, err := io.Conn.ReceiveMessage() + msg, err := io.Conn.ReceiveMessage(context.Background()) if err != nil { // Connection error, this will stop the session manager return nil, err diff --git a/core/server/udp.go b/core/server/udp.go index ea8cfaa2d4..246efede30 100644 --- a/core/server/udp.go +++ b/core/server/udp.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/quic-go/quic-go" + "github.com/apernet/quic-go" "github.com/apernet/hysteria/core/internal/frag" "github.com/apernet/hysteria/core/internal/protocol" diff --git a/extras/go.mod b/extras/go.mod index 027faf1b77..2b9472eac4 100644 --- a/extras/go.mod +++ b/extras/go.mod @@ -9,6 +9,7 @@ require ( ) require ( + github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/golang/mock v1.6.0 // indirect @@ -16,9 +17,7 @@ require ( github.com/onsi/ginkgo/v2 v2.9.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/qtls-go1-19 v0.3.2 // indirect - github.com/quic-go/qtls-go1-20 v0.2.2 // indirect - github.com/quic-go/quic-go v0.0.0-00010101000000-000000000000 // indirect + github.com/quic-go/qtls-go1-20 v0.3.0 // indirect github.com/stretchr/objx v0.5.0 // indirect golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect golang.org/x/mod v0.10.0 // indirect @@ -29,6 +28,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/quic-go/quic-go => github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d - replace github.com/apernet/hysteria/core => ../core diff --git a/extras/go.sum b/extras/go.sum index 7af56b1ce2..01b03d4306 100644 --- a/extras/go.sum +++ b/extras/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d h1:Yp2jez75QOlxae26CzyY3pmZzqRf/6C7b/DD8PSegPw= -github.com/apernet/quic-go v0.36.1-0.20230627042819-0a89ea8e4c8d/go.mod h1:zPetvwDlILVxt15n3hr3Gf/I3mDf7LpLKPhR4Ez0AZQ= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c h1:kl+p4uqk9sc/A9D0rgQ4IQxWMRVa3nSUFpvJ8/IQhe0= +github.com/apernet/quic-go v0.37.2-0.20230731235018-6dccf9f8de2c/go.mod h1:tKbqlrErvfl0qmDz6L0qpAGEZ/WduGkn4lwNTT7HyXg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -25,10 +25,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U= -github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= -github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E= -github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/qtls-go1-20 v0.3.0 h1:NrCXmDl8BddZwO67vlvEpBTwT89bJfKYygxv4HQvuDk= +github.com/quic-go/qtls-go1-20 v0.3.0/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=