Fix WiFiClient error handling (#1388)
This commit is contained in:
parent
00f962439a
commit
611db61d84
@ -313,7 +313,7 @@ uint8_t WiFiClient::connected()
|
|||||||
if (_connected) {
|
if (_connected) {
|
||||||
uint8_t dummy;
|
uint8_t dummy;
|
||||||
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
|
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
|
||||||
if (res <= 0) {
|
if (res < 0) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case ENOTCONN:
|
case ENOTCONN:
|
||||||
case EPIPE:
|
case EPIPE:
|
||||||
@ -328,7 +328,6 @@ uint8_t WiFiClient::connected()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Should never happen since requested 0 bytes
|
|
||||||
_connected = true;
|
_connected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user