From c7252a928a8e033eed55c5912ea6e34e15af70d2 Mon Sep 17 00:00:00 2001 From: Huiba Li Date: Fri, 11 Oct 2024 11:40:55 +0800 Subject: [PATCH] fix recv_at_least() (#593) --- net/basic_socket.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/net/basic_socket.cpp b/net/basic_socket.cpp index 5b5e8ac3..91665779 100644 --- a/net/basic_socket.cpp +++ b/net/basic_socket.cpp @@ -269,6 +269,7 @@ ssize_t ISocketStream::recv_at_least(void* buf, size_t count, size_t least, int if (ret < 0) return ret; if (ret == 0) break; // EOF if ((n += ret) >= least) break; + (char*&)buf += ret; count -= ret; } while (count); return n;