mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-06-22 08:31:07 +00:00
do not discard received data during RecvWaitAll when the other side closes the socket cleanly
This commit is contained in:
@@ -82,7 +82,8 @@ int RecvWaitAll(int sockfd, char *buf, int len) {
|
|||||||
while (offset < len) {
|
while (offset < len) {
|
||||||
int recv_status = recv(sockfd, &buf[offset], len - offset, MSG_WAITALL);
|
int recv_status = recv(sockfd, &buf[offset], len - offset, MSG_WAITALL);
|
||||||
if (recv_status == 0) {
|
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) {
|
if (recv_status == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user