From e1548e9b7e0b6e519a7f59052817152bfb16ab59 Mon Sep 17 00:00:00 2001 From: Roman Savrulin Date: Tue, 9 Jul 2019 19:34:24 +0300 Subject: [PATCH] Fix hang on client disconnect during upload (#2914) --- libraries/WebServer/src/Parsing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/WebServer/src/Parsing.cpp b/libraries/WebServer/src/Parsing.cpp index 303c99ad..e2e9cc43 100644 --- a/libraries/WebServer/src/Parsing.cpp +++ b/libraries/WebServer/src/Parsing.cpp @@ -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