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:
parent
3dd4b0d112
commit
1712fb5eee
1 changed files with 1 additions and 1 deletions
|
|
@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() {
|
||||||
}
|
}
|
||||||
if (_connected) {
|
if (_connected) {
|
||||||
uint8_t dummy;
|
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
|
// avoid unused var warning by gcc
|
||||||
(void)res;
|
(void)res;
|
||||||
// recv only sets errno if res is <= 0
|
// recv only sets errno if res is <= 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue