From 4af494e9c3f52bfd222eb4404c3cd9f64456cc84 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 30 Sep 2024 12:13:59 +1000 Subject: [PATCH] Set ConnectionIdMismatchNul error default log level to debug --- tracker/udp/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tracker/udp/client.go b/tracker/udp/client.go index 44d05137..91625380 100644 --- a/tracker/udp/client.go +++ b/tracker/udp/client.go @@ -10,6 +10,7 @@ import ( "time" "github.com/anacrolix/dht/v2/krpc" + "github.com/anacrolix/log" "github.com/protolambda/ctxlock" ) @@ -224,7 +225,11 @@ func (cl *Client) request( } else if dr.Header.Action == ActionError { // udp://tracker.torrent.eu.org:451/announce frequently returns "Connection ID // missmatch.\x00" - err = ErrorResponse{Message: string(dr.Body)} + stringBody := string(dr.Body) + err = ErrorResponse{Message: stringBody} + if stringBody == ConnectionIdMissmatchNul { + err = log.WithLevel(log.Debug, err) + } // Force a reconnection. Probably any error is worth doing this for, but the one we're // specifically interested in is ConnectionIdMissmatchNul. cl.connIdIssued = time.Time{} -- 2.48.1