debug messages optimized in http and cron
This commit is contained in:
parent
e6b67333df
commit
490bf91161
|
|
@ -69,9 +69,6 @@ static void ExecuteLastAction(obj_struct_t *objarr)
|
||||||
char *obj = objarr[obj_idx].object_name;
|
char *obj = objarr[obj_idx].object_name;
|
||||||
if (*obj == '\0')
|
if (*obj == '\0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//ESP_LOGI(TAG, "Check object %s", obj);
|
|
||||||
|
|
||||||
for (shdl = 0; shdl < CRON_TIMERS_NUMBER; shdl++)
|
for (shdl = 0; shdl < CRON_TIMERS_NUMBER; shdl++)
|
||||||
{
|
{
|
||||||
memcpy(objname, GetSysConf()->Timers[shdl].exec, CONFIG_WEBGUIAPP_MAX_COMMAND_STRING_LENGTH / 4);
|
memcpy(objname, GetSysConf()->Timers[shdl].exec, CONFIG_WEBGUIAPP_MAX_COMMAND_STRING_LENGTH / 4);
|
||||||
|
|
@ -98,7 +95,7 @@ static void ExecuteLastAction(obj_struct_t *objarr)
|
||||||
|
|
||||||
if (minimal != -1)
|
if (minimal != -1)
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG, "Run previous CRON \"%s\" with delta %d", GetSysConf()->Timers[minimal].exec, (int )delta);
|
ESP_LOGI(TAG, "Run previous CRON \"%s\" with delta %d", GetSysConf()->Timers[minimal].exec, (int )delta);
|
||||||
ExecCommand(GetSysConf()->Timers[minimal].exec);
|
ExecCommand(GetSysConf()->Timers[minimal].exec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +104,7 @@ static void ExecuteLastAction(obj_struct_t *objarr)
|
||||||
|
|
||||||
void TimeObtainHandler(struct timeval *tm)
|
void TimeObtainHandler(struct timeval *tm)
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG, "Current time received with value %d", (unsigned int )tm->tv_sec);
|
ESP_LOGI(TAG, "Current time updated with value %d", (unsigned int )tm->tv_sec);
|
||||||
ReloadCronSheduler();
|
ReloadCronSheduler();
|
||||||
ExecuteLastAction(GetSystemObjects());
|
ExecuteLastAction(GetSystemObjects());
|
||||||
ExecuteLastAction(GetCustomObjects());
|
ExecuteLastAction(GetCustomObjects());
|
||||||
|
|
|
||||||
|
|
@ -176,12 +176,11 @@ static const char* get_path_from_uri(char *dest, const char *base_path,
|
||||||
static esp_err_t POSTHandler(httpd_req_t *req)
|
static esp_err_t POSTHandler(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
||||||
ESP_LOGI(TAG, "POST request handle");
|
ESP_LOGI(TAG, "POST request handle URL: %s", req->uri);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (memmem(req->uri, strlen(req->uri), "/storage/upload/", sizeof("/storage/upload/") - 1))
|
if (memmem(req->uri, strlen(req->uri), "/storage/upload/", sizeof("/storage/upload/") - 1))
|
||||||
return upload_post_handler(req);
|
return upload_post_handler(req);
|
||||||
|
|
||||||
if (memmem(req->uri, strlen(req->uri), "/storage/delete/", sizeof("/storage/delete/") - 1))
|
if (memmem(req->uri, strlen(req->uri), "/storage/delete/", sizeof("/storage/delete/") - 1))
|
||||||
return delete_post_handler(req);
|
return delete_post_handler(req);
|
||||||
|
|
||||||
|
|
@ -240,7 +239,7 @@ static esp_err_t POSTHandler(httpd_req_t *req)
|
||||||
static esp_err_t GETHandler2(httpd_req_t *req)
|
static esp_err_t GETHandler2(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
||||||
ESP_LOGI(TAG, "GET request handle");
|
ESP_LOGI(TAG, "GET request handle URL: %s",req->uri);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Route to file server GET handler
|
//Route to file server GET handler
|
||||||
|
|
@ -291,7 +290,7 @@ static esp_err_t GETHandler2(httpd_req_t *req)
|
||||||
espfs_stat(fs, filepath, &stat);
|
espfs_stat(fs, filepath, &stat);
|
||||||
|
|
||||||
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
||||||
ESP_LOGI(TAG, "Sending file : %s (%d bytes)...", filename,
|
ESP_LOGI(TAG, "BEGIN send file : %s (%d bytes)...", filename,
|
||||||
stat.size);
|
stat.size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -334,6 +333,10 @@ static esp_err_t GETHandler2(httpd_req_t *req)
|
||||||
while (chunksize != 0);
|
while (chunksize != 0);
|
||||||
/* Close file after sending complete */
|
/* Close file after sending complete */
|
||||||
espfs_fclose(file);
|
espfs_fclose(file);
|
||||||
|
#if HTTP_SERVER_DEBUG_LEVEL > 0
|
||||||
|
ESP_LOGI(TAG, "END send file : %s (%d bytes)...", filename,
|
||||||
|
stat.size);
|
||||||
|
#endif
|
||||||
/* Respond with an empty chunk to signal HTTP response completion */
|
/* Respond with an empty chunk to signal HTTP response completion */
|
||||||
#ifdef CONFIG_EXAMPLE_HTTPD_CONN_CLOSE_HEADER
|
#ifdef CONFIG_EXAMPLE_HTTPD_CONN_CLOSE_HEADER
|
||||||
httpd_resp_set_hdr(req, "Connection", "close");
|
httpd_resp_set_hdr(req, "Connection", "close");
|
||||||
|
|
@ -346,7 +349,7 @@ static httpd_handle_t start_webserver(void)
|
||||||
{
|
{
|
||||||
httpd_handle_t server = NULL;
|
httpd_handle_t server = NULL;
|
||||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||||
config.lru_purge_enable = true;
|
config.lru_purge_enable = false;
|
||||||
config.uri_match_fn = httpd_uri_match_wildcard;
|
config.uri_match_fn = httpd_uri_match_wildcard;
|
||||||
config.stack_size = (4096 + 2048);
|
config.stack_size = (4096 + 2048);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user