leech now correctly calls OnError when ext msg cannot be decoded

This commit is contained in:
Bora M. Alper 2018-12-30 08:22:50 +03:00
parent eea341407d
commit c30f69d1e9
No known key found for this signature in database
GPG Key ID: 8F1A9504E1BD114D

View File

@ -335,7 +335,7 @@ func (l *Leech) Do(deadline time.Time) {
rExtDict := new(extDict)
err = bencode.NewDecoder(rMessageBuf).Decode(rExtDict)
if err != nil {
zap.L().Warn("Couldn't decode extension message in the loop!", zap.Error(err))
l.OnError(errors.Wrap(err, "could not decode ext msg in the loop"))
return
}