mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-31 14:26:43 -04:00
Tread ERROR_MORE_DATA as success and return the remaining n number of bytes required to be read.
This commit is contained in:
@@ -229,6 +229,9 @@ func (f *win32File) Read(b []byte) (int, error) {
|
||||
return 0, io.EOF
|
||||
} else if err == syscall.ERROR_BROKEN_PIPE {
|
||||
return 0, io.EOF
|
||||
// When there is more data in the message pipe to read, we get ERROR_MORE_DATA. We ignore that error and proceed to read more data
|
||||
} else if err == syscall.ERROR_MORE_DATA && n != 0 && len(b) != 0 {
|
||||
return n, nil
|
||||
} else {
|
||||
return n, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user