From 1712fb5eeee9069ad4e016c5fd6659b28ca397b0 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:17:38 -0300 Subject: [PATCH] fix(network): Avoid returning zero if connection is not dropped (#10640) Co-authored-by: NPaolini <75562717+NPaolini@users.noreply.github.com> --- libraries/Network/src/NetworkClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Network/src/NetworkClient.cpp b/libraries/Network/src/NetworkClient.cpp index 0782b74f2a9..067d288bf93 100644 --- a/libraries/Network/src/NetworkClient.cpp +++ b/libraries/Network/src/NetworkClient.cpp @@ -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