More unnecessary log shushing

This commit is contained in:
Matt Joiner 2015-03-27 15:37:58 +11:00
parent 60d8ea75a2
commit 5049f5d375
1 changed files with 2 additions and 3 deletions

View File

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