Track received handshake encryption activity
This commit is contained in:
parent
2940f27f9f
commit
2f14e5dbc0
|
@ -723,6 +723,15 @@ func (cl *Client) receiveHandshakes(c *connection) (t *Torrent, err error) {
|
||||||
var rw io.ReadWriter
|
var rw io.ReadWriter
|
||||||
rw, c.headerEncrypted, c.cryptoMethod, err = handleEncryption(c.rw(), cl.forSkeys, cl.config.EncryptionPolicy)
|
rw, c.headerEncrypted, c.cryptoMethod, err = handleEncryption(c.rw(), cl.forSkeys, cl.config.EncryptionPolicy)
|
||||||
c.setRW(rw)
|
c.setRW(rw)
|
||||||
|
if err == nil || err == mse.ErrNoSecretKeyMatch {
|
||||||
|
if c.headerEncrypted {
|
||||||
|
torrent.Add("handshakes received encrypted", 1)
|
||||||
|
} else {
|
||||||
|
torrent.Add("handshakes received unencrypted", 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
torrent.Add("handshakes received with error while handling encryption", 1)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == mse.ErrNoSecretKeyMatch {
|
if err == mse.ErrNoSecretKeyMatch {
|
||||||
err = nil
|
err = nil
|
||||||
|
|
Loading…
Reference in New Issue