]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix panic in logging
authorMatt Joiner <anacrolix@gmail.com>
Mon, 6 Jan 2020 23:44:58 +0000 (10:44 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 6 Jan 2020 23:44:58 +0000 (10:44 +1100)
Found by @ccampbell.

client.go

index 769a6a3793deb1c94fa5a701d618f7a1002a4f39..586f39bbb7ff96e2c3a17a7f397fa1eb915bdab2 100644 (file)
--- a/client.go
+++ b/client.go
@@ -843,7 +843,7 @@ func (cl *Client) runReceivedConn(c *connection) {
        }
        if t == nil {
                torrent.Add("received handshake for unloaded torrent", 1)
-               t.logger.Printf("received handshake for unloaded torrent")
+               log.Fmsg("received handshake for unloaded torrent").AddValue(debugLogValue).Log(cl.logger)
                cl.lock()
                cl.onBadAccept(c.remoteAddr)
                cl.unlock()