]> Sergey Matveev's repositories - btrtrc.git/commitdiff
More unnecessary log shushing
authorMatt Joiner <anacrolix@gmail.com>
Fri, 27 Mar 2015 04:37:58 +0000 (15:37 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 27 Mar 2015 04:37:58 +0000 (15:37 +1100)
client.go

index cc83037d9e021532f9bbbf824834715b59193895..d525b56f92e915939a4d917842c61a8914baad42 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1104,11 +1104,11 @@ func (me *Client) initiateHandshakes(c *connection, t *torrent) (ok bool, err er
        return
 }
 
+// Do encryption and bittorrent handshakes as receiver.
 func (cl *Client) receiveHandshakes(c *connection) (t *torrent, err error) {
        cl.mu.Lock()
        skeys := cl.receiveSkeys()
        cl.mu.Unlock()
-       // TODO: Filter unmatching skey errors.
        c.rw, c.encrypted, err = maybeReceiveEncryptedHandshake(c.rw, skeys)
        if err != nil {
                if err == mse.ErrNoSecretKeyMatch {
@@ -1162,8 +1162,7 @@ func (cl *Client) runReceivedConn(c *connection) (err error) {
        }
        t, err := cl.receiveHandshakes(c)
        if err != nil {
-               logonce.Stderr.Printf("error receiving handshakes: %s", err)
-               err = nil
+               err = fmt.Errorf("error receiving handshakes: %s", err)
                return
        }
        if t == nil {