Skip to content

Commit 5c0a5c8

Browse files
committed
🐛 Fix missing check for eof in socket::recv_exact
1 parent 82e797d commit 5c0a5c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/asyncpp/io/socket.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ namespace asyncpp::io {
496496
auto that = static_cast<socket_recv_exact_awaitable*>(ptr);
497497
auto engine = that->m_socket.service().engine();
498498
do {
499+
if (that->m_completion.result_size == 0) {
500+
that->m_completion.result = std::make_error_code(std::errc::not_connected);
501+
}
499502
if (that->m_completion.result) {
500503
that->m_handle.resume();
501504
break;

0 commit comments

Comments
 (0)