]> Sergey Matveev's repositories - btrtrc.git/commitdiff
tracker/udp: Reset connection ID on error response
authorMatt Joiner <anacrolix@gmail.com>
Tue, 3 Sep 2024 05:18:54 +0000 (15:18 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 3 Sep 2024 05:18:54 +0000 (15:18 +1000)
tracker/udp/client.go

index 077cc7a40bac83d9259e4d0c65fb417d054d1437..4664643dd244d65c958e508ce7eac15ef93d0d16 100644 (file)
@@ -225,6 +225,9 @@ func (cl *Client) request(
                        // udp://tracker.torrent.eu.org:451/announce frequently returns "Connection ID
                        // missmatch.\x00"
                        err = ErrorResponse{Message: string(dr.Body)}
+                       // 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{}
                } else {
                        err = fmt.Errorf("unexpected response action %v", dr.Header.Action)
                }