From 946e52da986dc332d158ebafca1258b38352b412 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 2 Mar 2017 12:32:32 +0200 Subject: [PATCH] Break on any error when flushing a client --- libraries/WiFi/src/WiFiClient.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp index a8f81b32..25c27582 100644 --- a/libraries/WiFi/src/WiFiClient.cpp +++ b/libraries/WiFi/src/WiFiClient.cpp @@ -266,12 +266,9 @@ void WiFiClient::flush() { while(a){ toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a; if(recv(fd(), buf, toRead, MSG_DONTWAIT) < 0) { - if(errno != EWOULDBLOCK){ - log_e("%d", errno); - stop(); - break; - } - delay(1);//give some time + log_e("%d", errno); + stop(); + break; } a = available(); }