8000 Fix WiFiClient error handling (#1388) · godspeednaomi/arduino-esp32@611db61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 611db61

Browse files
chemicstryme-no-dev
authored andcommitted
Fix WiFiClient error handling (espressif#1388)
1 parent 00f9624 commit 611db61

Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ uint8_t WiFiClient::connected()
313313
if (_connected) {
314314
uint8_t dummy;
315315
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
316-
if (res <= 0) {
316+
if (res < 0) {
317317
switch (errno) {
318318
case ENOTCONN:
319319
case EPIPE:
@@ -328,7 +328,6 @@ uint8_t WiFiClient::connected()
328328
}
329329
}
330330
else {
331-
// Should never happen since requested 0 bytes
332331
_connected = true;
333332
}
334333
}