mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-10-27 13:40:00 -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:
1 parent
211d6ebb39
commit
3f914f36b8
1 file changed
+3
@@ -229,6 +229,9 @@ func (f *win32File) Read(b []byte) (int, error) {
|
|||||||
return 0, io.EOF
|
return 0, io.EOF
|
||||||
} else if err == syscall.ERROR_BROKEN_PIPE {
|
} else if err == syscall.ERROR_BROKEN_PIPE {
|
||||||
return 0, io.EOF
|
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 {
|
} else {
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user