diff --git a/apps/httpserver_raw/fs.c b/apps/httpserver_raw/fs.c index a67eadd..d088abc 100644 --- a/apps/httpserver_raw/fs.c +++ b/apps/httpserver_raw/fs.c @@ -52,6 +52,9 @@ fs_open(const char *name, struct fs_file *file) if (!strcmp(name, (const char*)f->name)) { file->data = f->data; file->len = f->len; +#if HTTPD_SUPPORT_DYNAMIC_PAGES + file->includes_http_header = f->includes_http_header; +#endif return 1; } } diff --git a/apps/httpserver_raw/fs.h b/apps/httpserver_raw/fs.h index 1f7d434..538b352 100644 --- a/apps/httpserver_raw/fs.h +++ b/apps/httpserver_raw/fs.h @@ -32,9 +32,17 @@ #ifndef __FS_H__ #define __FS_H__ +/** Support dynamically created pages (free contents after sending) */ +#ifndef HTTPD_SUPPORT_DYNAMIC_PAGES +#define HTTPD_SUPPORT_DYNAMIC_PAGES 1 +#endif + struct fs_file { const unsigned char *data; int len; +#if HTTPD_SUPPORT_DYNAMIC_PAGES + u8_t includes_http_header; +#endif /* HTTPD_SUPPORT_DYNAMIC_PAGES */ }; /* file must be allocated by caller and will be filled in