better codez

This commit is contained in:
2016-03-17 23:51:14 +01:00
parent b9885c8b1a
commit a8e85d256e
3 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -44,7 +44,10 @@ typedef struct {
int ICACHE_FLASH_ATTR tplMultipart(HttpdConnData *connData, char *token, void **arg)
{
if (token == NULL) {
if (*arg != NULL) free(*arg);
if (*arg != NULL) {
free(*arg);
*arg = NULL; // mark as already freed
}
return HTTPD_CGI_DONE; // cleanup
}
@@ -81,6 +84,7 @@ int ICACHE_FLASH_ATTR tplMultipart(HttpdConnData *connData, char *token, void **
if (rns->count_remain == 0) {
free(rns);
*arg = NULL; // mark as already freed
return HTTPD_CGI_DONE;
}
@@ -90,7 +94,7 @@ int ICACHE_FLASH_ATTR tplMultipart(HttpdConnData *connData, char *token, void **
return HTTPD_CGI_DONE;
}
/*
// better to put it in the fs...
int FLASH_FN cgiRandomNumbers(HttpdConnData *connData) {
@@ -161,3 +165,4 @@ int FLASH_FN cgiRandomNumbers(HttpdConnData *connData) {
return HTTPD_CGI_MORE;
}
*/
+1 -1
View File
@@ -6,7 +6,7 @@
int tplCounter(HttpdConnData *connData, char *token, void **arg);
int cgiRandomNumbers(HttpdConnData *connData);
//int cgiRandomNumbers(HttpdConnData *connData);
int tplMultipart(HttpdConnData *connData, char *token, void **arg);
+1 -1
View File
@@ -113,7 +113,7 @@ static HttpdBuiltInUrl builtInUrls[] = {
{"/multipart.tpl", cgiEspFsTemplate, (void *)tplMultipart},
{"/random.tpl", cgiRandomNumbers, NULL},
// {"/random.tpl", cgiRandomNumbers, NULL},
//Enable the line below to protect the WiFi configuration with an username/password combo.
// {"/wifi/*", authBasic, (void *)myPassFn},