未验证 提交 7e40de22 编写于 作者: M M Hotchin 提交者: GitHub

Fixes #4435 - WiFiClient improperly treats zero data available for read as an error (#4448)

上级 1287c529
......@@ -105,7 +105,7 @@ public:
int read(uint8_t * dst, size_t len){
if(!dst || !len || (_pos == _fill && !fillBuffer())){
return -1;
return _failed ? -1 : 0;
}
size_t a = _fill - _pos;
if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){
......@@ -346,6 +346,9 @@ int WiFiClient::read()
if(res < 0) {
return res;
}
if (res == 0) { // No data available.
return -1;
}
return data;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册