mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 14:16:40 +00:00
Add timeout and delay to http img src
This commit is contained in:
parent
b3230fcd4c
commit
78629de89b
@ -1328,6 +1328,8 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa
|
|||||||
#if HASP_USE_WIFI > 0 || HASP_USE_ETHERNET > 0
|
#if HASP_USE_WIFI > 0 || HASP_USE_ETHERNET > 0
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
http.begin(payload);
|
http.begin(payload);
|
||||||
|
http.setTimeout(1000);
|
||||||
|
http.setConnectTimeout(5000);
|
||||||
|
|
||||||
// const char* hdrs[] = {"Content-Type"};
|
// const char* hdrs[] = {"Content-Type"};
|
||||||
// size_t numhdrs = sizeof(hdrs) / sizeof(char*);
|
// size_t numhdrs = sizeof(hdrs) / sizeof(char*);
|
||||||
@ -1430,7 +1432,7 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa
|
|||||||
// LOG_DEBUG(TAG_ATTR, D_BULLET "IMG DATA: %d bytes read=%d buf_len=%d", c, read, buf_len);
|
// LOG_DEBUG(TAG_ATTR, D_BULLET "IMG DATA: %d bytes read=%d buf_len=%d", c, read, buf_len);
|
||||||
read += c;
|
read += c;
|
||||||
} else {
|
} else {
|
||||||
// delay(1); // wait for data
|
delay(1); // wait for data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user