-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix WiFiClientRxBuffer::fillBuffer() error, likely solves issue #2212 #2259
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…from the call to recv()
@lbernstone, @nikuz confirmed that my PR fixes the error. Also, the if() in WiFiClientRxBuffer::fillBuffer() before my PR is obviously wrong... |
Verified. Looks like you included some BLE stuff in your commit, tho. |
@lbernstone You are right, I always pull remote master before creating a branch. So I was surpised to have some BLE stuff in my local master |
I can not merge this with the BLE stuff in there ;) |
@me-no-dev can you help me get it out? I did a git pull upstream master and then it got in...???? |
delete the BLE folder then call |
Replaced by #2263 |
Fix WiFiClientRxBuffer::fillBuffer() error in handing a negative res from the call to recv()
In
arduino-esp32/libraries/WiFi/src/WiFiClient.cpp
Line 70 in 229d9b7
The condition res < 0 && errno == EWOULDBLOCK simply means that the socket has no data available (yet), so _fill should not change and, since nothing is read, the return value of fillBuffer should be zero.
This most likely solves the complete #2212 issue, at least it solves the minimum sketch reproducing the error as posted in that issue by @lbernstone. This could also be the root cause of other issues, since on slow connections it is likely that the socket not always has data available.
I also added an extra test on
arduino-esp32/libraries/WiFi/src/WiFiClient.cpp
Line 60 in 229d9b7
Happy New Year to everyone!