Improve some log messages
This commit is contained in:
parent
0b553b296f
commit
9285470cc6
@ -848,7 +848,7 @@ func (cl *Client) runHandshookConn(c *connection, t *Torrent, outgoing bool) {
|
|||||||
cl.sendInitialMessages(c, t)
|
cl.sendInitialMessages(c, t)
|
||||||
err := c.mainReadLoop()
|
err := c.mainReadLoop()
|
||||||
if err != nil && cl.config.Debug {
|
if err != nil && cl.config.Debug {
|
||||||
log.Printf("error during connection loop: %s", err)
|
log.Printf("error during connection main read loop: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,20 +175,20 @@ func (h *handshake) postY(x *big.Int) error {
|
|||||||
return h.postWrite(paddedLeft(y.Bytes(), 96))
|
return h.postWrite(paddedLeft(y.Bytes(), 96))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *handshake) establishS() (err error) {
|
func (h *handshake) establishS() error {
|
||||||
x := newX()
|
x := newX()
|
||||||
h.postY(&x)
|
h.postY(&x)
|
||||||
var b [96]byte
|
var b [96]byte
|
||||||
_, err = io.ReadFull(h.conn, b[:])
|
_, err := io.ReadFull(h.conn, b[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return fmt.Errorf("error reading Y: %s", err)
|
||||||
}
|
}
|
||||||
var Y, S big.Int
|
var Y, S big.Int
|
||||||
Y.SetBytes(b[:])
|
Y.SetBytes(b[:])
|
||||||
S.Exp(&Y, &x, &p)
|
S.Exp(&Y, &x, &p)
|
||||||
sBytes := S.Bytes()
|
sBytes := S.Bytes()
|
||||||
copy(h.s[96-len(sBytes):96], sBytes)
|
copy(h.s[96-len(sBytes):96], sBytes)
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newPadLen() int64 {
|
func newPadLen() int64 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user