We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1287c52 commit 7e40de2Copy full SHA for 7e40de2
libraries/WiFi/src/WiFiClient.cpp
@@ -105,7 +105,7 @@ class WiFiClientRxBuffer {
105
106
int read(uint8_t * dst, size_t len){
107
if(!dst || !len || (_pos == _fill && !fillBuffer())){
108
- return -1;
+ return _failed ? -1 : 0;
109
}
110
size_t a = _fill - _pos;
111
if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){
@@ -346,6 +346,9 @@ int WiFiClient::read()
346
if(res < 0) {
347
return res;
348
349
+ if (res == 0) { // No data available.
350
+ return -1;
351
+ }
352
return data;
353
354
0 commit comments