Skip to content

Commit

Permalink
reset temporary errors
Browse files Browse the repository at this point in the history
  • Loading branch information
calbot committed Nov 27, 2020
1 parent e09d524 commit 1dad860
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,8 @@ func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
c.messageReader = nil
c.readLength = 0

if e, ok := c.readErr.(*netError); ok && e.Temporary() {
e, ok := c.readErr.(*netError)
if ok && e.Temporary() || e.Temporary() {
//Reset temporary errors
c.readErr = nil
}
Expand Down Expand Up @@ -1016,8 +1017,9 @@ func (r *messageReader) Read(b []byte) (int, error) {
if c.messageReader != r {
return 0, io.EOF
}

if e, ok := c.readErr.(*netError); ok && e.Temporary() {

e, ok := c.readErr.(*netError)
if ok && e.Temporary() || e.Temporary() {
//Reset temporary errors
c.readErr = nil
}
Expand Down

0 comments on commit 1dad860

Please sign in to comment.