Skip to content

Commit

Permalink
Set ConnectionIdMismatchNul error default log level to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Sep 30, 2024
1 parent e5ae1f0 commit 4af494e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tracker/udp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/anacrolix/dht/v2/krpc"
"github.com/anacrolix/log"
"github.com/protolambda/ctxlock"
)

Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 4af494e

Please sign in to comment.