From 4878d5c2ecf9fbca8cc9b11d73a02c236393a18e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 11 Nov 2015 16:31:46 +0100 Subject: [PATCH] WiFi: partially fix flush() behaviour We still need to check if trasmission is completed, BTW this commit should alleviate bugs involving data loss. See #4029 --- libraries/WiFi/src/WiFiClient.cpp | 3 +-- libraries/WiFi/src/WiFiUdp.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp index 8fb413499..eb8e6af1d 100644 --- a/libraries/WiFi/src/WiFiClient.cpp +++ b/libraries/WiFi/src/WiFiClient.cpp @@ -140,8 +140,7 @@ int WiFiClient::peek() { } void WiFiClient::flush() { - while (available()) - read(); + // TODO: a real check to ensure transmission has been completed } void WiFiClient::stop() { diff --git a/libraries/WiFi/src/WiFiUdp.cpp b/libraries/WiFi/src/WiFiUdp.cpp index 45298c5bc..954024339 100644 --- a/libraries/WiFi/src/WiFiUdp.cpp +++ b/libraries/WiFi/src/WiFiUdp.cpp @@ -155,8 +155,7 @@ int WiFiUDP::peek() void WiFiUDP::flush() { - while (available()) - read(); + // TODO: a real check to ensure transmission has been completed } IPAddress WiFiUDP::remoteIP()