From c43d0778287bbc3bb171b75651fd2d864fbc1bfb Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 1 Nov 2009 21:00:43 +0000 Subject: [PATCH] Add support to files that don't include HTTP response header --- apps/httpserver_raw/fs.c | 3 +++ apps/httpserver_raw/fs.h | 8 ++++++++ 2 files changed, 11 insertions(+) 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