readout prototype

This commit is contained in:
2016-03-26 18:51:28 +01:00
parent f4b4aa123c
commit d57d8dd692
19 changed files with 234 additions and 207 deletions
+14 -9
View File
@@ -73,16 +73,21 @@ typedef struct {
//The mappings from file extensions to mime types. If you need an extra mime type,
//add it here.
static const ICACHE_RODATA_ATTR MimeMap mimeTypes[]={
{"htm", "text/htm"},
// html
{"html", "text/html"},
{"css", "text/css"},
{"js", "text/javascript"},
{"txt", "text/plain"},
{"jpg", "image/jpeg"},
{"jpeg", "image/jpeg"},
{"png", "image/png"},
{"svg", "image/svg+xml"},
{NULL, "text/html"}, //default value
{"css", "text/css"},
{"json", "application/json"},
{"js", "text/javascript"},
{"txt", "text/plain"},
{"csv", "text/csv"},
// images
{"ico", "image/x-icon"},
{"jpg", "image/jpeg"},
{"png", "image/png"},
{"svg", "image/svg+xml"},
{NULL, "text/html"}, //default value
};
//Returns a static char* to a mime type for a given url to a file.
+1 -1
View File
@@ -194,7 +194,7 @@ int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData)
if (connData->conn == NULL) {
//Connection aborted. Clean up.
((TplCallback)(connData->cgiArg))(connData, NULL, &tpd->tplArg);
((TplCallback)(connData->cgiArg))(connData, NULL, &tpd->tplArg); // call the template func with NULL token
espFsClose(tpd->file);
free(tpd);
return HTTPD_CGI_DONE;