Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
7e40de22
Unverified
Commit
7e40de22
authored
Oct 27, 2020
by
M Hotchin
Committed by
GitHub
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4435 - WiFiClient improperly treats zero data available for read as an error (#4448)
parent
1287c529
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
libraries/WiFi/src/WiFiClient.cpp
libraries/WiFi/src/WiFiClient.cpp
+4
-1
No files found.
libraries/WiFi/src/WiFiClient.cpp
View file @
7e40de22
...
@@ -105,7 +105,7 @@ public:
...
@@ -105,7 +105,7 @@ public:
int
read
(
uint8_t
*
dst
,
size_t
len
){
int
read
(
uint8_t
*
dst
,
size_t
len
){
if
(
!
dst
||
!
len
||
(
_pos
==
_fill
&&
!
fillBuffer
())){
if
(
!
dst
||
!
len
||
(
_pos
==
_fill
&&
!
fillBuffer
())){
return
-
1
;
return
_failed
?
-
1
:
0
;
}
}
size_t
a
=
_fill
-
_pos
;
size_t
a
=
_fill
-
_pos
;
if
(
len
<=
a
||
((
len
-
a
)
<=
(
_size
-
_fill
)
&&
fillBuffer
()
>=
(
len
-
a
))){
if
(
len
<=
a
||
((
len
-
a
)
<=
(
_size
-
_fill
)
&&
fillBuffer
()
>=
(
len
-
a
))){
...
@@ -346,6 +346,9 @@ int WiFiClient::read()
...
@@ -346,6 +346,9 @@ int WiFiClient::read()
if
(
res
<
0
)
{
if
(
res
<
0
)
{
return
res
;
return
res
;
}
}
if
(
res
==
0
)
{
// No data available.
return
-
1
;
}
return
data
;
return
data
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment