Browse Source

httpd: ssi: support selecting ssi files by file flags, not by extension (at runtime) only

STABLE-2_1_x
goldsimon 9 years ago
parent
commit
da01bc4d15
  1. 12
      src/apps/httpd/httpd.c
  2. 2
      src/include/lwip/apps/fs.h

12
src/apps/httpd/httpd.c

@ -2234,8 +2234,16 @@ http_find_file(struct http_state *hs, const char *uri, int is_09)
} else {
file = http_get_404_file(hs, &uri);
}
#if LWIP_HTTPD_SSI && LWIP_HTTPD_SSI_BY_FILE_EXTENSION
tag_check = http_uri_is_ssi(file, uri);
#if LWIP_HTTPD_SSI
if (file != NULL) {
if (file->flags & FS_FILE_FLAGS_SSI) {
tag_check = 1;
} else {
#if LWIP_HTTPD_SSI_BY_FILE_EXTENSION
tag_check = http_uri_is_ssi(file, uri);
#endif /* LWIP_HTTPD_SSI_BY_FILE_EXTENSION */
}
}
#endif /* LWIP_HTTPD_SSI */
}
if (file == NULL) {

2
src/include/lwip/apps/fs.h

@ -52,6 +52,8 @@ struct fsdata_chksum {
#define FS_FILE_FLAGS_HEADER_INCLUDED 0x01
#define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02
#define FS_FILE_FLAGS_HEADER_KEEPALIVE 0x04
#define FS_FILE_FLAGS_SSI 0x08
/** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private
* pointer type (defaults to 'void' so the default usage is 'void*')

Loading…
Cancel
Save