]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Log connection errors when debug mode
authorMatt Joiner <anacrolix@gmail.com>
Tue, 22 Mar 2016 02:10:18 +0000 (13:10 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 22 Mar 2016 02:10:18 +0000 (13:10 +1100)
client.go

index a257cf847ab0cbbc33be5659a782411af7c9b3d5..0146ab4d0fb6c2fc66348db4e1a49d7eed8db109 100644 (file)
--- a/client.go
+++ b/client.go
@@ -781,6 +781,9 @@ func (me *Client) outgoingConnection(t *torrent, addr string, ps peerSource) {
        // failure.
        me.noLongerHalfOpen(t, addr)
        if err != nil {
+               if me.config.Debug {
+                       log.Printf("error establishing outgoing connection: %s", err)
+               }
                return
        }
        if c == nil {
@@ -790,7 +793,9 @@ func (me *Client) outgoingConnection(t *torrent, addr string, ps peerSource) {
        c.Discovery = ps
        err = me.runInitiatedHandshookConn(c, t)
        if err != nil {
-               // log.Print(err)
+               if me.config.Debug {
+                       log.Printf("error in established outgoing connection: %s", err)
+               }
        }
 }