From 9285470cc6b622d1b2da975070ecb330b3c71117 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 25 Jan 2018 13:10:52 +1100 Subject: [PATCH] Improve some log messages --- client.go | 2 +- mse/mse.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 290ea711..fba0b1e2 100644 --- a/client.go +++ b/client.go @@ -848,7 +848,7 @@ func (cl *Client) runHandshookConn(c *connection, t *Torrent, outgoing bool) { cl.sendInitialMessages(c, t) err := c.mainReadLoop() if err != nil && cl.config.Debug { - log.Printf("error during connection loop: %s", err) + log.Printf("error during connection main read loop: %s", err) } } diff --git a/mse/mse.go b/mse/mse.go index 9771507b..898cd3d7 100644 --- a/mse/mse.go +++ b/mse/mse.go @@ -175,20 +175,20 @@ func (h *handshake) postY(x *big.Int) error { return h.postWrite(paddedLeft(y.Bytes(), 96)) } -func (h *handshake) establishS() (err error) { +func (h *handshake) establishS() error { x := newX() h.postY(&x) var b [96]byte - _, err = io.ReadFull(h.conn, b[:]) + _, err := io.ReadFull(h.conn, b[:]) if err != nil { - return + return fmt.Errorf("error reading Y: %s", err) } var Y, S big.Int Y.SetBytes(b[:]) S.Exp(&Y, &x, &p) sBytes := S.Bytes() copy(h.s[96-len(sBytes):96], sBytes) - return + return nil } func newPadLen() int64 { -- 2.50.0