Skip to content

Commit b417db6

Browse files
committed
Ignore ERROR_MORE_DATA as a non-fatal error when returned by
GetOverlappedResult for a synchronous read.
1 parent 99077c6 commit b417db6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

asio/include/asio/detail/impl/win_iocp_handle_service.ipp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,17 @@ size_t win_iocp_handle_service::do_read(
439439
if (!ok)
440440
{
441441
DWORD last_error = ::GetLastError();
442-
if (last_error == ERROR_HANDLE_EOF)
442+
if (last_error != ERROR_MORE_DATA)
443443
{
444-
ec = asio::error::eof;
445-
}
446-
else
447-
{
448-
ec = asio::error_code(last_error,
449-
asio::error::get_system_category());
444+
if (last_error == ERROR_HANDLE_EOF)
445+
{
446+
ec = asio::error::eof;
447+
}
448+
else
449+
{
450+
ec = asio::error_code(last_error,
451+
asio::error::get_system_category());
452+
}
450453
}
451454
return 0;
452455
}

0 commit comments

Comments
 (0)