fix(network): Avoid returning zero if connection is not dropped (#10640)

Co-authored-by: NPaolini <75562717+NPaolini@users.noreply.github.com>
This commit is contained in:
Lucas Saavedra Vaz 2024-11-25 07:17:38 -03:00 committed by GitHub
parent 3dd4b0d112
commit 1712fb5eee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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