overwrite files in storage partition, cron log file switche off
This commit is contained in:
parent
f2448d6dc3
commit
9fbb16a5db
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#define REAST_API_DEBUG_MODE 0
|
#define REAST_API_DEBUG_MODE 0
|
||||||
|
|
||||||
#define EXPECTED_MAX_DATA_SIZE (4096 + 2048)
|
#define EXPECTED_MAX_DATA_SIZE (4096 * 2)
|
||||||
#define VAR_MAX_NAME_LENGTH (32)
|
#define VAR_MAX_NAME_LENGTH (32)
|
||||||
#define VAR_MAX_VALUE_LENGTH (EXPECTED_MAX_DATA_SIZE - 512)
|
#define VAR_MAX_VALUE_LENGTH (EXPECTED_MAX_DATA_SIZE - 512)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ void TimeObtainHandler(struct timeval *tm)
|
||||||
ReloadCronSheduler();
|
ReloadCronSheduler();
|
||||||
ExecuteLastAction(GetSystemObjects());
|
ExecuteLastAction(GetSystemObjects());
|
||||||
ExecuteLastAction(GetCustomObjects());
|
ExecuteLastAction(GetCustomObjects());
|
||||||
LogFile("cron.log", "Cron service started");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugTimer()
|
void DebugTimer()
|
||||||
|
|
|
||||||
|
|
@ -329,13 +329,7 @@ esp_err_t upload_post_handler(httpd_req_t *req)
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stat(filepath, &file_stat) == 0)
|
|
||||||
{
|
|
||||||
ESP_LOGE(TAG, "File already exists : %s", filepath);
|
|
||||||
/* Respond with 400 Bad Request */
|
|
||||||
httpd_resp_send_err(req, HTTPD_400_BAD_REQUEST, "File already exists");
|
|
||||||
return ESP_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* File cannot be larger than a limit */
|
/* File cannot be larger than a limit */
|
||||||
if (req->content_len > MAX_FILE_SIZE)
|
if (req->content_len > MAX_FILE_SIZE)
|
||||||
|
|
@ -350,6 +344,19 @@ esp_err_t upload_post_handler(httpd_req_t *req)
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stat(filepath, &file_stat) == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
ESP_LOGW(TAG, "File already exists : %s", filepath);
|
||||||
|
/* Respond with 400 Bad Request */
|
||||||
|
//httpd_resp_send_err(req, HTTPD_400_BAD_REQUEST, "File already exists");
|
||||||
|
//return ESP_FAIL;
|
||||||
|
unlink(filepath);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fd = fopen(filepath, "w");
|
fd = fopen(filepath, "w");
|
||||||
if (!fd)
|
if (!fd)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user