Skip to content

Commit

Permalink
OTA: check for client connected during fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Jun 4, 2024
1 parent d9a3b25 commit a94a742
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ota/interface/OTAInterfaceDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a94a742

Please sign in to comment.