Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e40de2

Browse filesBrowse files
authored
Fixes espressif#4435 - WiFiClient improperly treats zero data available for read as an error (espressif#4448)
1 parent 1287c52 commit 7e40de2
Copy full SHA for 7e40de2

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎libraries/WiFi/src/WiFiClient.cpp

Copy file name to clipboardExpand all lines: libraries/WiFi/src/WiFiClient.cpp
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class WiFiClientRxBuffer {
105105

106106
int read(uint8_t * dst, size_t len){
107107
if(!dst || !len || (_pos == _fill && !fillBuffer())){
108-
return -1;
108+
return _failed ? -1 : 0;
109109
}
110110
size_t a = _fill - _pos;
111111
if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){
@@ -346,6 +346,9 @@ int WiFiClient::read()
346346
if(res < 0) {
347347
return res;
348348
}
349+
if (res == 0) { // No data available.
350+
return -1;
351+
}
349352
return data;
350353
}
351354

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.