Add support to files that don't include HTTP response header

This commit is contained in:
goldsimon 2009-11-01 21:00:43 +00:00
parent b9113fe615
commit c43d077828
2 changed files with 11 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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