Skip to content

Commit 092d7ac

Browse files
authored
Merge pull request #478 from pennam/ota-client-connected
OTA: check for client connected during fetch
2 parents cf6593b + e1280af commit 092d7ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/ota/interface/OTAInterfaceDefault.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
9393
uint32_t start = millis();
9494

9595
do {
96+
if(!http_client->connected()) {
97+
res = OtaDownloadFail;
98+
goto exit;
99+
}
100+
96101
if(http_client->available() == 0) {
97102
/* Avoid tight loop and allow yield */
98103
delay(1);

0 commit comments

Comments
 (0)