Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
NativeSocket: fix infinite loop in recvall
Browse files Browse the repository at this point in the history
  • Loading branch information
minexew committed Feb 8, 2017
1 parent c69d031 commit dbfd7be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SnailNet/NativeSocket.HC
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ I64 recvall(I64 sockfd, U8* buf, I64 len, I64 flags) {
while (len) {
I64 got = recv(sockfd, buf + total, len, flags);

if (got < 0)
if (got <= 0)
break;

len -= got;
Expand Down

0 comments on commit dbfd7be

Please sign in to comment.