| 1 |
From: "Xiaokang Wang (Shelikhoo)" <[email protected]> |
| 2 |
Date: Mon, 30 Jun 2025 05:13:51 +0100 |
| 3 |
Subject: Update quic version to v0.53.0 (#3435) |
| 4 |
|
| 5 |
Closes: #1114137 |
| 6 |
|
| 7 |
(cherry picked from commit eff7df91d094eb8276ae0dbd9f6b83009724c0fa) |
| 8 |
--- |
| 9 |
app/dns/nameserver_quic.go | 12 ++++++------ |
| 10 |
transport/internet/quic/conn.go | 2 +- |
| 11 |
transport/internet/quic/dialer.go | 4 ++-- |
| 12 |
transport/internet/quic/hub.go | 2 +- |
| 13 |
4 files changed, 10 insertions(+), 10 deletions(-) |
| 14 |
|
| 15 |
diff --git a/app/dns/nameserver_quic.go b/app/dns/nameserver_quic.go |
| 16 |
index 0e9d0fd..5dc6aa6 100644 |
| 17 |
--- a/app/dns/nameserver_quic.go |
| 18 |
+++ b/app/dns/nameserver_quic.go |
| 19 |
@@ -38,7 +38,7 @@ type QUICNameServer struct { |
| 20 |
reqID uint32 |
| 21 |
name string |
| 22 |
destination net.Destination |
| 23 |
- connection quic.Connection |
| 24 |
+ connection *quic.Conn |
| 25 |
} |
| 26 |
|
| 27 |
// NewQUICNameServer creates DNS-over-QUIC client object for local resolving |
| 28 |
@@ -316,7 +316,7 @@ func (s *QUICNameServer) QueryIP(ctx context.Context, domain string, clientIP ne |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
-func isActive(s quic.Connection) bool { |
| 33 |
+func isActive(s *quic.Conn) bool { |
| 34 |
select { |
| 35 |
case <-s.Context().Done(): |
| 36 |
return false |
| 37 |
@@ -325,8 +325,8 @@ func isActive(s quic.Connection) bool { |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
-func (s *QUICNameServer) getConnection() (quic.Connection, error) { |
| 42 |
- var conn quic.Connection |
| 43 |
+func (s *QUICNameServer) getConnection() (*quic.Conn, error) { |
| 44 |
+ var conn *quic.Conn |
| 45 |
s.RLock() |
| 46 |
conn = s.connection |
| 47 |
if conn != nil && isActive(conn) { |
| 48 |
@@ -359,7 +359,7 @@ func (s *QUICNameServer) getConnection() (quic.Connection, error) { |
| 49 |
return conn, nil |
| 50 |
} |
| 51 |
|
| 52 |
-func (s *QUICNameServer) openConnection() (quic.Connection, error) { |
| 53 |
+func (s *QUICNameServer) openConnection() (*quic.Conn, error) { |
| 54 |
tlsConfig := tls.Config{ |
| 55 |
ServerName: func() string { |
| 56 |
switch s.destination.Address.Family() { |
| 57 |
@@ -384,7 +384,7 @@ func (s *QUICNameServer) openConnection() (quic.Connection, error) { |
| 58 |
return conn, nil |
| 59 |
} |
| 60 |
|
| 61 |
-func (s *QUICNameServer) openStream(ctx context.Context) (quic.Stream, error) { |
| 62 |
+func (s *QUICNameServer) openStream(ctx context.Context) (*quic.Stream, error) { |
| 63 |
conn, err := s.getConnection() |
| 64 |
if err != nil { |
| 65 |
return nil, err |
| 66 |
diff --git a/transport/internet/quic/conn.go b/transport/internet/quic/conn.go |
| 67 |
index c951ada..b67a942 100644 |
| 68 |
--- a/transport/internet/quic/conn.go |
| 69 |
+++ b/transport/internet/quic/conn.go |
| 70 |
@@ -142,7 +142,7 @@ func (c *sysConn) SetWriteDeadline(t time.Time) error { |
| 71 |
} |
| 72 |
|
| 73 |
type interConn struct { |
| 74 |
- stream quic.Stream |
| 75 |
+ stream *quic.Stream |
| 76 |
local net.Addr |
| 77 |
remote net.Addr |
| 78 |
} |
| 79 |
diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go |
| 80 |
index b0d1677..c8b5830 100644 |
| 81 |
--- a/transport/internet/quic/dialer.go |
| 82 |
+++ b/transport/internet/quic/dialer.go |
| 83 |
@@ -17,7 +17,7 @@ import ( |
| 84 |
|
| 85 |
type connectionContext struct { |
| 86 |
rawConn *sysConn |
| 87 |
- conn quic.Connection |
| 88 |
+ conn *quic.Conn |
| 89 |
} |
| 90 |
|
| 91 |
var errConnectionClosed = newError("connection closed") |
| 92 |
@@ -47,7 +47,7 @@ type clientConnections struct { |
| 93 |
cleanup *task.Periodic |
| 94 |
} |
| 95 |
|
| 96 |
-func isActive(s quic.Connection) bool { |
| 97 |
+func isActive(s *quic.Conn) bool { |
| 98 |
select { |
| 99 |
case <-s.Context().Done(): |
| 100 |
return false |
| 101 |
diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go |
| 102 |
index eba02da..4aaaea4 100644 |
| 103 |
--- a/transport/internet/quic/hub.go |
| 104 |
+++ b/transport/internet/quic/hub.go |
| 105 |
@@ -23,7 +23,7 @@ type Listener struct { |
| 106 |
addConn internet.ConnHandler |
| 107 |
} |
| 108 |
|
| 109 |
-func (l *Listener) acceptStreams(conn quic.Connection) { |
| 110 |
+func (l *Listener) acceptStreams(conn *quic.Conn) { |
| 111 |
for { |
| 112 |
stream, err := conn.AcceptStream(context.Background()) |
| 113 |
if err != nil { |