Skip to content

Commit 90086dc

Browse files
chemicstryCurclamas
authored andcommitted
Fix WiFiClient error handling (espressif#1388)
1 parent 5f39728 commit 90086dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/WiFi/src/WiFiClient.cpp

+1-2
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
}

0 commit comments

Comments
 (0)