Skip to content

Commit

Permalink
fix(network): Avoid returning zero if connection is not dropped (#10640)
Browse files Browse the repository at this point in the history
Co-authored-by: NPaolini <[email protected]>
  • Loading branch information
lucasssvaz and NPaolini authored Nov 25, 2024
1 parent 3dd4b0d commit 1712fb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/Network/src/NetworkClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() {
}
if (_connected) {
uint8_t dummy;
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
int res = recv(fd(), &dummy, 1, MSG_DONTWAIT | MSG_PEEK);
// avoid unused var warning by gcc
(void)res;
// recv only sets errno if res is <= 0
Expand Down

0 comments on commit 1712fb5

Please sign in to comment.