Skip to content

Commit

Permalink
Merge pull request #478 from pennam/ota-client-connected
Browse files Browse the repository at this point in the history
OTA: check for client connected during fetch
  • Loading branch information
pennam authored Jun 10, 2024
2 parents cf6593b + e1280af commit 092d7ac
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 092d7ac

Please sign in to comment.