2
0
mirror of synced 2025-02-23 22:28:11 +00:00
This commit is contained in:
Matt Joiner 2017-09-15 12:56:54 +10:00
parent d4576a56d9
commit 846ac2d33e

View File

@ -637,6 +637,7 @@ func (cl *Client) establishOutgoingConn(t *Torrent, addr string) (c *connection,
obfuscatedHeaderFirst := !cl.config.DisableEncryption && !cl.config.PreferNoEncryption
c, err = cl.handshakesConnection(ctx, nc, t, obfuscatedHeaderFirst, utp)
if err != nil {
// log.Printf("error initiating connection handshakes: %s", err)
nc.Close()
return
} else if c != nil {
@ -660,7 +661,7 @@ func (cl *Client) establishOutgoingConn(t *Torrent, addr string) (c *connection,
nc, err = cl.dialTCP(ctx, addr)
}
if err != nil {
err = fmt.Errorf("error dialing for unencrypted connection: %s", err)
err = fmt.Errorf("error dialing for header encryption fallback: %s", err)
return
}
c, err = cl.handshakesConnection(ctx, nc, t, !obfuscatedHeaderFirst, utp)