Skip to content

Commit

Permalink
Bump github.com/quic-go/quic-go from 0.34.0 to 0.35.1
Browse files Browse the repository at this point in the history
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](quic-go/quic-go@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] <[email protected]>
  • Loading branch information
dependabot[bot] authored and yuhan6665 committed Jun 1, 2023
1 parent 6b8e36f commit 86b4b81
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/dns/nameserver_quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
16 changes: 8 additions & 8 deletions transport/internet/quic/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package quic

import (
"context"
"io"
"sync"
"time"

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
17 changes: 9 additions & 8 deletions transport/internet/quic/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package quic

import (
"context"
"io"
"time"

"github.com/quic-go/quic-go"
Expand All @@ -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
}
Expand Down Expand Up @@ -104,24 +103,26 @@ 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)
if err != nil {
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
Expand Down
4 changes: 3 additions & 1 deletion transport/internet/quic/qlogWriter.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

0 comments on commit 86b4b81

Please sign in to comment.