From 23760da53b66d10c96c4f0c66701be1fdcf99845 Mon Sep 17 00:00:00 2001 From: Katharine Chui Date: Thu, 30 Apr 2026 20:17:05 +0200 Subject: [PATCH] do not discard received data during RecvWaitAll when the other side closes the socket cleanly --- src/Network/VehicleEvent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Network/VehicleEvent.cpp b/src/Network/VehicleEvent.cpp index f6038de..60a4bf5 100644 --- a/src/Network/VehicleEvent.cpp +++ b/src/Network/VehicleEvent.cpp @@ -82,7 +82,8 @@ int RecvWaitAll(int sockfd, char *buf, int len) { while (offset < len) { int recv_status = recv(sockfd, &buf[offset], len - offset, MSG_WAITALL); if (recv_status == 0) { - return 0; + // do not discard received data when the other side closes the socket cleanly + return offset; } if (recv_status == -1) { return -1;