Skip to content

Commit 1712fb5

Browse files
lucasssvazNPaolini
andauthored
fix(network): Avoid returning zero if connection is not dropped (#10640)
Co-authored-by: NPaolini <75562717+NPaolini@users.noreply.github.com>
1 parent 3dd4b0d commit 1712fb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libraries/Network/src/NetworkClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() {
549549
}
550550
if (_connected) {
551551
uint8_t dummy;
552-
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
552+
int res = recv(fd(), &dummy, 1, MSG_DONTWAIT | MSG_PEEK);
553553
// avoid unused var warning by gcc
554554
(void)res;
555555
// recv only sets errno if res is <= 0

0 commit comments

Comments
 (0)