diff --git a/asio/include/asio/detail/impl/socket_ops.ipp b/asio/include/asio/detail/impl/socket_ops.ipp index 1fb3a15e..1eb749ee 100644 --- a/asio/include/asio/detail/impl/socket_ops.ipp +++ b/asio/include/asio/detail/impl/socket_ops.ipp @@ -771,7 +771,7 @@ signed_size_type recv(socket_type s, buf* bufs, size_t count, else if (ec.value() == ERROR_PORT_UNREACHABLE) ec = asio::error::connection_refused; else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) - ec.assign(0, ec.category()); + result = 0; if (result != 0) return socket_error_retval; ec = asio::error_code(); @@ -925,7 +925,7 @@ signed_size_type recvfrom(socket_type s, buf* bufs, size_t count, else if (ec.value() == ERROR_PORT_UNREACHABLE) ec = asio::error::connection_refused; else if (ec.value() == WSAEMSGSIZE || ec.value() == ERROR_MORE_DATA) - ec.assign(0, ec.category()); + result = 0; if (result != 0) return socket_error_retval; ec = asio::error_code();