Skip to content

Commit

Permalink
fix recv_at_least() (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba authored Oct 11, 2024
1 parent 5ba5018 commit c7252a9
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 c7252a9

Please sign in to comment.