From 3fbb84f9507b0b0017c0e69b0a72e09063865c9a Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Sun, 24 Mar 2019 21:47:56 +0100 Subject: [PATCH] Fix bug #55702: SSI bug Apply patch from Stanislav --- src/apps/http/httpd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/apps/http/httpd.c b/src/apps/http/httpd.c index ccc9ba72..fc27e8ef 100644 --- a/src/apps/http/httpd.c +++ b/src/apps/http/httpd.c @@ -1301,6 +1301,22 @@ http_send_data_ssi(struct altcp_pcb *pcb, struct http_state *hs) ssi->tag_state = TAG_NONE; } +#if LWIP_HTTPD_DYNAMIC_FILE_READ && !LWIP_HTTPD_SSI_INCLUDE_TAG + if ((ssi->tag_state == TAG_NONE) && + (ssi->parsed - hs->file < ssi->tag_index)) { + for(u16_t i = 0;i < ssi->tag_index;i++) { + ssi->tag_insert[i] = http_ssi_tag_desc[ssi->tag_type].lead_in[i]; + } + ssi->tag_insert_len = ssi->tag_index; + hs->file += ssi->parsed - hs->file; + hs->left -= ssi->parsed - hs->file; + ssi->tag_end = hs->file; + ssi->tag_index = 0; + ssi->tag_state = TAG_SENDING; + break; + } +#endif + /* Move on to the next character in the buffer */ ssi->parse_left--; ssi->parsed++;