From e1280af412f650e350ec39407778145f15066ce0 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 31 May 2024 11:32:04 +0200 Subject: [PATCH] OTA: check for client connected during fetch --- src/ota/interface/OTAInterfaceDefault.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ota/interface/OTAInterfaceDefault.cpp b/src/ota/interface/OTAInterfaceDefault.cpp index 9e9891c85..fabb145a4 100644 --- a/src/ota/interface/OTAInterfaceDefault.cpp +++ b/src/ota/interface/OTAInterfaceDefault.cpp @@ -93,6 +93,11 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() { uint32_t start = millis(); do { + if(!http_client->connected()) { + res = OtaDownloadFail; + goto exit; + } + if(http_client->available() == 0) { /* Avoid tight loop and allow yield */ delay(1);