Revert "Moved FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET into config-system"

This reverts commit ccc8eb0e3601e0769988426f3f59713ff6071a61.
This commit is contained in:
CommanderRedYT
2022-01-29 03:41:19 +01:00
parent a66d48de7d
commit 377564ff34
8 changed files with 121 additions and 132 deletions

View File

@@ -46,11 +46,10 @@ httpd_handle_t httpdHandle;
void initWebserver()
{
if (!configs.feature.webserver_disable_lock.value)
{
webserver_lock.construct();
webserver_lock->take(portMAX_DELAY);
}
#ifndef FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
webserver_lock.construct();
webserver_lock->take(portMAX_DELAY);
#endif
{
httpd_config_t httpConfig HTTPD_DEFAULT_CONFIG();
@@ -92,12 +91,11 @@ void initWebserver()
void handleWebserver()
{
if (!configs.feature.webserver_disable_lock.value)
{
webserver_lock->give();
vTaskDelay(1);
webserver_lock->take(portMAX_DELAY);
}
#ifndef FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
webserver_lock->give();
vTaskDelay(1);
webserver_lock->take(portMAX_DELAY);
#endif
}
namespace {
@@ -158,16 +156,15 @@ bool menuDisplayChanged()
esp_err_t webserver_status_handler(httpd_req_t *req)
{
if (!configs.feature.webserver_disable_lock.value)
#ifndef FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
espcpputils::LockHelper helper{webserver_lock->handle, std::chrono::ceil<espcpputils::ticks>(5s).count()};
if (!helper.locked())
{
espcpputils::LockHelper helper{webserver_lock->handle, std::chrono::ceil<espcpputils::ticks>(5s).count()};
if (!helper.locked())
{
constexpr const std::string_view msg = "could not lock webserver_lock";
ESP_LOGE(TAG, "%.*s", msg.size(), msg.data());
CALL_AND_EXIT(esphttpdutils::webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg);
}
constexpr const std::string_view msg = "could not lock webserver_lock";
ESP_LOGE(TAG, "%.*s", msg.size(), msg.data());
CALL_AND_EXIT(esphttpdutils::webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg);
}
#endif
CALL_AND_EXIT_ON_ERROR(httpd_resp_set_hdr, req, "Access-Control-Allow-Origin", "http://web.bobbycar.cloud");