win, pipe: stop read for overlapped pipe

Adds CancelIoEx call when uv_read_stop on overlapped pipe.

Refs: https://github.com/nodejs/node/pull/19377
PR-URL: https://github.com/libuv/libuv/pull/1822
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Bartosz Sosnowski 2018-04-26 19:45:36 +02:00 committed by cjihrig
parent 0b3c4997a8
commit 0f53cd0517
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -735,6 +735,13 @@ void uv__pipe_unpause_read(uv_pipe_t* handle) {
void uv__pipe_stop_read(uv_pipe_t* handle) {
if (pCancelIoEx &&
!(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) &&
!(handle->flags & UV_HANDLE_EMULATE_IOCP) &&
handle->flags & UV_HANDLE_READING &&
handle->read_req.type == UV_READ) {
pCancelIoEx(handle->handle, &handle->read_req.u.io.overlapped);
}
handle->flags &= ~UV_HANDLE_READING;
uv__pipe_pause_read((uv_pipe_t*)handle);
uv__pipe_unpause_read((uv_pipe_t*)handle);