fix(client): Make flush() call clear() and deprecate it (#10242)

This is a compromise for issues caused by https://github.com/espressif/arduino-esp32/pull/9453
This commit is contained in:
Me No Dev 2024-08-28 09:54:25 +03:00 committed by GitHub
parent df4518d6a1
commit 7633653019
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 2 deletions

View File

@ -369,7 +369,9 @@ int NetworkClient::read() {
return data;
}
void NetworkClient::flush() {}
void NetworkClient::flush() {
clear();
}
size_t NetworkClient::write(const uint8_t *buf, size_t size) {
int res = 0;

View File

@ -56,6 +56,7 @@ public:
size_t write(const uint8_t *buf, size_t size);
size_t write_P(PGM_P buf, size_t size);
size_t write(Stream &stream);
[[deprecated("Use clear() instead.")]]
void flush(); // Print::flush tx
int available();
int read();

View File

@ -288,7 +288,9 @@ size_t NetworkUDP::write(const uint8_t *buffer, size_t size) {
return i;
}
void NetworkUDP::flush() {}
void NetworkUDP::flush() {
clear();
}
int NetworkUDP::parsePacket() {
if (rx_buffer) {

View File

@ -64,6 +64,7 @@ public:
int endPacket();
size_t write(uint8_t);
size_t write(const uint8_t *buffer, size_t size);
[[deprecated("Use clear() instead.")]]
void flush(); // Print::flush tx
int parsePacket();
int available();