Fix `realNonblockingRead`, set `realNonblockingRead` call error to `nonblockReadErr`

pull/1540/head
Dmitry K 2023-02-26 00:14:33 +03:00 committed by Jack Christensen
parent 087b8b2ba8
commit 0dbb0a52ab
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ func (c *NetConn) realNonblockingRead(b []byte) (n int, err error) {
c.nonblockReadFunc = func(fd uintptr) (done bool) {
// Make sock non-blocking
if err := setSockMode(fd, sockModeNonBlocking); err != nil {
c.nonblockWriteErr = err
c.nonblockReadErr = err
return true
}
@ -110,7 +110,7 @@ func (c *NetConn) realNonblockingRead(b []byte) (n int, err error) {
// Make sock blocking again
if err := setSockMode(fd, sockModeBlocking); err != nil {
c.nonblockWriteErr = err
c.nonblockReadErr = err
return true
}