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 {
231231 // * ERROR_INVALID_PARAMETER - The handle likely doesn't have FILE_FLAG_OVERLAPPED, which might indicate that it isn't a pipe
232232 // so we can just signal that it is ready for reading right away.
233233 //
234- continuation. yield ( UInt32 . max )
234+ continuation. yield ( 0 )
235235 }
236236 }
237237 // Now save the continuation
@@ -322,18 +322,15 @@ final class AsyncIO: @unchecked Sendable {
322322
323323 }
324324
325+ // Depending on whether the handle is overlapped, or not find the bytes read
326+ // from the pointer, or the signal stream.
325327 let bytesRead =
326328 if bytesReadIfSynchronous == 0 {
327329 try await signalStream. next ( ) ?? 0
328330 } else {
329331 bytesReadIfSynchronous
330332 }
331333
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-
337334 if bytesRead == 0 {
338335 // We reached EOF. Return whatever's left
339336 guard readLength > 0 else {
You can’t perform that action at this time.
0 commit comments