Description: compatibility with golang-github-go-quic-go-quic 0.38.2
Author: Félix Sipma <felix@debian.org>
Forwarded: not-needed
Last-Update: 2024-01-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/lib/connections/quic_misc.go
+++ b/lib/connections/quic_misc.go
@@ -80,15 +80,15 @@ type writeTrackingTracer struct {
 	lastWrite atomic.Int64 // unix nanos
 }
 
-func (t *writeTrackingTracer) loggingTracer() *logging.Tracer {
-	return &logging.Tracer{
-		SentPacket: func(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame) {
-			t.lastWrite.Store(time.Now().UnixNano())
-		},
-		SentVersionNegotiationPacket: func(net.Addr, logging.ArbitraryLenConnectionID, logging.ArbitraryLenConnectionID, []logging.VersionNumber) {
-			t.lastWrite.Store(time.Now().UnixNano())
-		},
-	}
+func (t *writeTrackingTracer) SentPacket(net.Addr, *logging.Header, logging.ByteCount, []logging.Frame) {
+	t.lastWrite.Store(time.Now().UnixNano())
+}
+
+func (t *writeTrackingTracer) SentVersionNegotiationPacket(_ net.Addr, dest, src logging.ArbitraryLenConnectionID, _ []quic.VersionNumber) {
+	t.lastWrite.Store(time.Now().UnixNano())
+}
+
+func (t *writeTrackingTracer) DroppedPacket(net.Addr, logging.PacketType, logging.ByteCount, logging.PacketDropReason) {
 }
 
 func (t *writeTrackingTracer) LastWrite() time.Time {
@@ -115,7 +115,7 @@ func (t *transportPacketConn) WriteTo(p
 	return t.tran.WriteTo(p, addr)
 }
 
-func (*transportPacketConn) Close() error {
+func (t *transportPacketConn) Close() error {
 	return errUnsupported
 }
 
@@ -132,6 +132,6 @@ func (t *transportPacketConn) SetReadDea
 	return nil
 }
 
-func (*transportPacketConn) SetWriteDeadline(_ time.Time) error {
+func (t *transportPacketConn) SetWriteDeadline(_ time.Time) error {
 	return nil // yolo
 }
--- a/lib/connections/quic_listen.go
+++ b/lib/connections/quic_listen.go
@@ -100,7 +100,7 @@ func (t *quicListener) serve(ctx context
 	tracer := &writeTrackingTracer{}
 	quicTransport := &quic.Transport{
 		Conn:   udpConn,
-		Tracer: tracer.loggingTracer(),
+		Tracer: tracer,
 	}
 	defer quicTransport.Close()
 
