File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ final class AsyncIO: @unchecked Sendable {
231
231
// * ERROR_INVALID_PARAMETER - The handle likely doesn't have FILE_FLAG_OVERLAPPED, which might indicate that it isn't a pipe
232
232
// so we can just signal that it is ready for reading right away.
233
233
//
234
- continuation. yield ( UInt32 . max )
234
+ continuation. yield ( 0 )
235
235
}
236
236
}
237
237
// Now save the continuation
@@ -322,18 +322,15 @@ final class AsyncIO: @unchecked Sendable {
322
322
323
323
}
324
324
325
+ // Depending on whether the handle is overlapped, or not find the bytes read
326
+ // from the pointer, or the signal stream.
325
327
let bytesRead =
326
328
if bytesReadIfSynchronous == 0 {
327
329
try await signalStream. next ( ) ?? 0
328
330
} else {
329
331
bytesReadIfSynchronous
330
332
}
331
333
332
- // This handle doesn't support overlapped (asynchronous) I/O, so we must have read it synchronously above
333
- if bytesRead == UInt32 . max {
334
- bytesRead = bytesReadIfSynchronous
335
- }
336
-
337
334
if bytesRead == 0 {
338
335
// We reached EOF. Return whatever's left
339
336
guard readLength > 0 else {
You can’t perform that action at this time.
0 commit comments