Skip to content

Commit b8d5305

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ota/interface/OTAInterfaceDefault.cpp

+3-1
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)