add firehazard.c

This commit is contained in:
2020-01-09 00:32:53 +01:00
parent ef7866a29f
commit d0d82ee8fb
14 changed files with 533 additions and 49 deletions
+11 -5
View File
@@ -166,11 +166,17 @@ esp_err_t tpl_kv_replacer(httpd_req_t *r, void *context, const char *token, tpl_
struct tpl_kv_list *head = context;
SLIST_FOREACH(entry, head, link) {
if (0==strcmp(entry->key, token)) {
return httpd_resp_send_chunk_escaped(r,
entry->subst_heap ?
entry->subst_heap :
entry->subst,
-1, escape);
if (entry->subst_heap) {
if (entry->subst_heap[0]) {
return httpd_resp_send_chunk_escaped(r, entry->subst_heap, -1, escape);
}
} else {
if (entry->subst[0]) {
return httpd_resp_send_chunk_escaped(r, entry->subst, -1, escape);
}
return ESP_OK;
}
return ESP_OK;
}
}