Propagate and log more connection read/write errors now that logging is a bit fancier

This commit is contained in:
Matt Joiner 2020-05-03 18:40:09 +10:00
parent dad5ab89a5
commit a7b665873c
1 changed files with 2 additions and 1 deletions

View File

@ -625,6 +625,7 @@ func (cn *PeerConn) writer(keepAliveTimeout time.Duration) {
keepAliveTimer.Reset(keepAliveTimeout)
}
if err != nil {
cn.logger.Printf("error writing: %v", err)
return
}
if n != frontBuf.Len() {
@ -1022,7 +1023,7 @@ func (c *PeerConn) mainReadLoop() (err error) {
defer cl.lock()
err = decoder.Decode(&msg)
}()
if t.closed.IsSet() || c.closed.IsSet() || err == io.EOF {
if t.closed.IsSet() || c.closed.IsSet() {
return nil
}
if err != nil {