Description
Board
Any
Device Description
Hardware Configuration
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Windows 11
Flash frequency
Any
PSRAM enabled
yes
Upload speed
115200
Description
See current implementation of clear()
:
arduino-esp32/libraries/Network/src/NetworkClient.cpp
Lines 149 to 155 in e70f4d3
and fillBuffer()
:
arduino-esp32/libraries/Network/src/NetworkClient.cpp
Lines 63 to 88 in e70f4d3
When the rx buffer is full or there is more data available than would fit in the buffer, the buffer is not cleared.
Suggested code change:
void clear() {
if (r_available()) {
_pos = _fill;
while(fillBuffer())
_pos = _fill;
}
_pos = 0;
_fill = 0;
}
Only drawback I can think of with my suggested change is when there is a continuous amount of data to be cleared.
However this would in the current situation also have lead to issues.
Sketch
-
Debug Message
-
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.