From: Nilesh Patra <nilesh@debian.org>
Date: Wed, 11 Jan 2023 18:27:58 +0800
Subject: Compatibility with golang-github-lucas-clemente-quic-go 0.29

---
 lib/connections/quic_misc.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/connections/quic_misc.go b/lib/connections/quic_misc.go
index fb8e704..1e502e1 100644
--- a/lib/connections/quic_misc.go
+++ b/lib/connections/quic_misc.go
@@ -13,6 +13,7 @@ import (
 	"crypto/tls"
 	"net"
 	"net/url"
+	"time"
 
 	"github.com/lucas-clemente/quic-go"
 )
@@ -20,7 +21,8 @@ import (
 var (
 	quicConfig = &quic.Config{
 		ConnectionIDLength: 4,
-		KeepAlive:          true,
+		MaxIdleTimeout:     30 * time.Second,
+		KeepAlivePeriod:    15 * time.Second,
 	}
 )
 
@@ -36,7 +38,7 @@ func quicNetwork(uri *url.URL) string {
 }
 
 type quicTlsConn struct {
-	quic.Session
+	quic.Connection
 	quic.Stream
 	// If we created this connection, we should be the ones closing it.
 	createdConn net.PacketConn
@@ -44,7 +46,7 @@ type quicTlsConn struct {
 
 func (q *quicTlsConn) Close() error {
 	sterr := q.Stream.Close()
-	seerr := q.Session.CloseWithError(0, "closing")
+	seerr := q.Connection.CloseWithError(0, "closing")
 	var pcerr error
 	if q.createdConn != nil {
 		pcerr = q.createdConn.Close()
@@ -59,7 +61,7 @@ func (q *quicTlsConn) Close() error {
 }
 
 func (q *quicTlsConn) ConnectionState() tls.ConnectionState {
-	return q.Session.ConnectionState().TLS.ConnectionState
+	return q.Connection.ConnectionState().TLS.ConnectionState
 }
 
 func packetConnUnspecified(conn interface{}) bool {
