Fixes #20196.
Change-Id: Ib87f6e9e27a38f21f860b7150c818d77be653dd3
Reviewed-on: https://go-review.googlesource.com/42370
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
mu sync.Mutex // guards following
hasByte bool
byteBuf [1]byte
- bgErr error // non-nil means error happened on background read
cond *sync.Cond
inRead bool
aborted bool // set true before conn.rwc deadline is set to past
cr.unlock()
return 0, io.EOF
}
- if cr.bgErr != nil {
- err = cr.bgErr
- cr.unlock()
- return 0, err
- }
if len(p) == 0 {
cr.unlock()
return 0, nil