Skip to content

Commit

Permalink
fix recv_at_least()
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed Oct 10, 2024
1 parent e62865a commit 493fcc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/basic_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 493fcc4

Please sign in to comment.