From 86b4b81f1d126e9bb3c463c987e54e12a0177d02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 00:59:07 +0000 Subject: [PATCH] Bump github.com/quic-go/quic-go from 0.34.0 to 0.35.1 Bumps [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go) from 0.34.0 to 0.35.1. - [Release notes](https://github.com/quic-go/quic-go/releases) - [Changelog](https://github.com/quic-go/quic-go/blob/master/Changelog.md) - [Commits](https://github.com/quic-go/quic-go/compare/v0.34.0...v0.35.1) --- updated-dependencies: - dependency-name: github.com/quic-go/quic-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- app/dns/nameserver_quic.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- transport/internet/quic/dialer.go | 16 ++++++++-------- transport/internet/quic/hub.go | 17 +++++++++-------- transport/internet/quic/qlogWriter.go | 4 +++- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/app/dns/nameserver_quic.go b/app/dns/nameserver_quic.go index a362ec84..a312b784 100644 --- a/app/dns/nameserver_quic.go +++ b/app/dns/nameserver_quic.go @@ -374,7 +374,7 @@ func (s *QUICNameServer) openConnection() (quic.Connection, error) { HandshakeIdleTimeout: handshakeTimeout, } - conn, err := quic.DialAddrContext(context.Background(), s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto("http/1.1", http2.NextProtoTLS, NextProtoDQ)), quicConfig) + conn, err := quic.DialAddr(context.Background(), s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto("http/1.1", http2.NextProtoTLS, NextProtoDQ)), quicConfig) log.Record(&log.AccessMessage{ From: "DNS", To: s.destination, diff --git a/go.mod b/go.mod index 5d069097..883de3c9 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/miekg/dns v1.1.54 github.com/pelletier/go-toml v1.9.5 github.com/pires/go-proxyproto v0.7.0 - github.com/quic-go/quic-go v0.34.0 + github.com/quic-go/quic-go v0.35.1 github.com/refraction-networking/utls v1.3.2 github.com/sagernet/sing v0.2.4 github.com/sagernet/sing-shadowsocks v0.2.1 diff --git a/go.sum b/go.sum index 8efc6300..135e85e2 100644 --- a/go.sum +++ b/go.sum @@ -135,8 +135,8 @@ github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc8 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/quic-go v0.34.0 h1:OvOJ9LFjTySgwOTYUZmNoq0FzVicP8YujpV0kB7m2lU= -github.com/quic-go/quic-go v0.34.0/go.mod h1:+4CVgVppm0FNjpG3UcX8Joi/frKOH7/ciD5yGcwOO1g= +github.com/quic-go/quic-go v0.35.1 h1:b0kzj6b/cQAf05cT0CkQubHM31wiA+xH3IBkxP62poo= +github.com/quic-go/quic-go v0.35.1/go.mod h1:+4CVgVppm0FNjpG3UcX8Joi/frKOH7/ciD5yGcwOO1g= github.com/refraction-networking/utls v1.3.2 h1:o+AkWB57mkcoW36ET7uJ002CpBWHu0KPxi6vzxvPnv8= github.com/refraction-networking/utls v1.3.2/go.mod h1:fmoaOww2bxzzEpIKOebIsnBvjQpqP7L2vcm/9KUfm/E= github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index 0b9483ce..f0d8e4e1 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -2,7 +2,6 @@ package quic import ( "context" - "io" "sync" "time" @@ -140,15 +139,13 @@ func (s *clientConnections) openConnection(ctx context.Context, destAddr net.Add } quicConfig := &quic.Config{ - ConnectionIDLength: 12, KeepAlivePeriod: 0, HandshakeIdleTimeout: time.Second * 8, MaxIdleTimeout: time.Second * 300, - Tracer: qlog.NewTracer(func(_ logging.Perspective, connID []byte) io.WriteCloser { - return &QlogWriter{connID: connID} - }), + Tracer: func(ctx context.Context, p logging.Perspective, ci quic.ConnectionID) logging.ConnectionTracer { + return qlog.NewConnectionTracer( &QlogWriter{connID: ci}, p, ci); + }, } - udpConn, _ := rawConn.(*net.UDPConn) if udpConn == nil { udpConn = rawConn.(*internet.PacketConnWrapper).Conn.(*net.UDPConn) @@ -158,8 +155,11 @@ func (s *clientConnections) openConnection(ctx context.Context, destAddr net.Add rawConn.Close() return nil, err } - - conn, err := quic.DialContext(context.Background(), sysConn, destAddr, "", tlsConfig.GetTLSConfig(tls.WithDestination(dest)), quicConfig) + tr := quic.Transport{ + ConnectionIDLength: 12, + Conn: sysConn, + } + conn, err := tr.Dial(context.Background(), destAddr, tlsConfig.GetTLSConfig(tls.WithDestination(dest)), quicConfig) if err != nil { sysConn.Close() return nil, err diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index 9b6481c5..15f072ec 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -2,7 +2,6 @@ package quic import ( "context" - "io" "time" "github.com/quic-go/quic-go" @@ -19,7 +18,7 @@ import ( // Listener is an internet.Listener that listens for TCP connections. type Listener struct { rawConn *sysConn - listener quic.Listener + listener *quic.Listener done *done.Instance addConn internet.ConnHandler } @@ -104,15 +103,14 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti } quicConfig := &quic.Config{ - ConnectionIDLength: 12, KeepAlivePeriod: 0, HandshakeIdleTimeout: time.Second * 8, MaxIdleTimeout: time.Second * 300, MaxIncomingStreams: 32, MaxIncomingUniStreams: -1, - Tracer: qlog.NewTracer(func(_ logging.Perspective, connID []byte) io.WriteCloser { - return &QlogWriter{connID: connID} - }), + Tracer: func(ctx context.Context, p logging.Perspective, ci quic.ConnectionID) logging.ConnectionTracer { + return qlog.NewConnectionTracer( &QlogWriter{connID: ci}, p, ci); + }, } conn, err := wrapSysConn(rawConn.(*net.UDPConn), config) @@ -120,8 +118,11 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti conn.Close() return nil, err } - - qListener, err := quic.Listen(conn, tlsConfig.GetTLSConfig(), quicConfig) + tr := quic.Transport{ + ConnectionIDLength: 12, + Conn: conn, + } + qListener, err := tr.Listen(tlsConfig.GetTLSConfig(), quicConfig) if err != nil { conn.Close() return nil, err diff --git a/transport/internet/quic/qlogWriter.go b/transport/internet/quic/qlogWriter.go index dd13f419..54284d29 100644 --- a/transport/internet/quic/qlogWriter.go +++ b/transport/internet/quic/qlogWriter.go @@ -1,7 +1,9 @@ package quic +import "github.com/quic-go/quic-go" + type QlogWriter struct { - connID []byte + connID quic.ConnectionID } func (w *QlogWriter) Write(b []byte) (int, error) {