Break on any error when flushing a client

This commit is contained in:
me-no-dev 2017-03-02 12:32:32 +02:00
parent 6fc96b977f
commit 946e52da98

View File

@ -266,13 +266,10 @@ void WiFiClient::flush() {
while(a){ while(a){
toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a; toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a;
if(recv(fd(), buf, toRead, MSG_DONTWAIT) < 0) { if(recv(fd(), buf, toRead, MSG_DONTWAIT) < 0) {
if(errno != EWOULDBLOCK){
log_e("%d", errno); log_e("%d", errno);
stop(); stop();
break; break;
} }
delay(1);//give some time
}
a = available(); a = available();
} }
free(buf); free(buf);