diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 5eec65b2f..f762777ca 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -27,3 +27,4 @@ For more details go to [emsesp.org](https://emsesp.org/). - Dewtemperature for Easycontrol calculated by ems-esp [#3135](https://github.com/emsesp/EMS-ESP32/issues/3135) - add option for sync thermostat to ntp, allow different time zones [#3148](https://github.com/emsesp/EMS-ESP32/discussions/3148), **defaults to sync**. - block too many GET requests [mentioned in #3104](https://github.com/emsesp/EMS-ESP32/issues/3104) +- set 10 sec timeout for http requests [#3104](https://github.com/emsesp/EMS-ESP32/issues/3104) diff --git a/src/core/shuntingYard.cpp b/src/core/shuntingYard.cpp index e0c795da1..3d9e8a1a3 100644 --- a/src/core/shuntingYard.cpp +++ b/src/core/shuntingYard.cpp @@ -728,6 +728,8 @@ std::string compute(const std::string & expr) { } if (url.substr(0, 4) == "http") { // match http and https HTTPClient * http = new HTTPClient; + http->setConnectTimeout(10000); + http->setTimeout(10000); if (http->begin(url.c_str())) { int httpResult = 0; for (JsonPair p : doc[header_s].as()) { diff --git a/src/emsesp_version.h b/src/emsesp_version.h index 9c7c9b638..fe1387c14 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.8.3-dev.8d" +#define EMSESP_APP_VERSION "3.8.3-dev.8e" diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index 03a3ceaca..0569ecd69 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -355,7 +355,9 @@ bool WebSchedulerService::command(const char * name, const std::string & command JsonDocument doc; if (deserializeJson(doc, cmd) == DeserializationError::Ok) { HTTPClient * http = new HTTPClient; - std::string url = doc["url"] | ""; + http->setConnectTimeout(10000); + http->setTimeout(10000); + std::string url = doc["url"] | ""; // for a GET with parameters replace commands with values // don't search the complete url, it may contain a devicename in path auto q = url.find_first_of('?');