Fix hang on client disconnect during upload (#2914)

This commit is contained in:
Roman Savrulin 2019-07-09 19:34:24 +03:00 committed by Me No Dev
parent c29ec9da3d
commit e1548e9b7e

View File

@ -303,6 +303,7 @@ void WebServer::_uploadWriteByte(uint8_t b){
}
int WebServer::_uploadReadByte(WiFiClient& client){
if (!client.connected()) return -1;
int res = client.read();
if(res < 0) {
// keep trying until you either read a valid byte or timeout