better codez
This commit is contained in:
+7
-2
@@ -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
@@ -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
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user