Log connection errors when debug mode

This commit is contained in:
Matt Joiner 2016-03-22 13:10:18 +11:00
parent 0c877a9d94
commit 01bef851ed
1 changed files with 6 additions and 1 deletions

View File

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