Skip to content

Commit

Permalink
win,pipe: ipc code does not support async read
Browse files Browse the repository at this point in the history
The implementation of IPC pipe in libuv on Windows does not properly support
async reading. This means we cannot set the more parameter without likely
causing hangs. Sorry this is yet another followup to libuv#4511.

Fixes libuv#4548
  • Loading branch information
vtjnash committed Sep 30, 2024
1 parent bcc6d1c commit 2120010
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/win/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2094,17 +2094,13 @@ static int uv__pipe_read_ipc(uv_loop_t* loop, uv_pipe_t* handle) {
/* Store the pending socket info. */
uv__pipe_queue_ipc_xfer_info(handle, xfer_type, &xfer_info);
}

more = 1;
}

/* Return whether the caller should immediately try another read call to get
* more data. */
if (more && *data_remaining == 0) {
/* TODO: use PeekNamedPipe to see if it is really worth trying to do
* another ReadFile call. */
}

* more data. Calling uv__pipe_read_exactly will hang if there isn't data
* available, so we cannot do this unless we are guaranteed not to reach that.
*/
more = *data_remaining > 0;
return more;

invalid:
Expand Down

0 comments on commit 2120010

Please sign in to comment.