Skip to content

Commit d9a3b25

Browse files
committed
OTA: make fetch blocking for real and also wait for data
1 parent e918cb6 commit d9a3b25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ota/interface/OTAInterfaceDefault.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
9494

9595
do {
9696
if(http_client->available() == 0) {
97-
goto exit;
97+
/* Avoid tight loop and allow yield */
98+
delay(1);
99+
continue;
98100
}
99101

100102
http_res = http_client->read(context->buffer, context->buf_len);

0 commit comments

Comments
 (0)