Return correct number of bytes transferred when datagram truncation occurs.
This commit is contained in:
parent
3b0daafa0b
commit
555ed6c993
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user