Unverified Commit 76336530 authored by Me No Dev's avatar Me No Dev Committed by GitHub

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
parent df4518d6
......@@ -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;
......
......@@ -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();
......
......@@ -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) {
......
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment