makefsdata: add information about SSI and about the version of the included header to files

Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
goldsimon 2017-11-21 12:22:19 +01:00
parent 839e5ecec6
commit 26f55f1eb3
2 changed files with 21 additions and 1 deletions

View File

@ -768,6 +768,9 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename)
fprintf(data_file, NEWLINE);
is_ssi = is_ssi_file(filename);
if (is_ssi) {
flags |= FS_FILE_FLAGS_SSI;
}
has_content_len = !is_ssi;
can_be_compressed = includeHttpHeader && !is_ssi;
file_data = get_file_data(filename, &file_size, can_be_compressed, &is_compressed);
@ -776,6 +779,9 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename)
flags |= FS_FILE_FLAGS_HEADER_INCLUDED;
if (has_content_len) {
flags |= FS_FILE_FLAGS_HEADER_PERSISTENT;
if (useHttp11) {
flags |= FS_FILE_FLAGS_HEADER_HTTPVER_1_1;
}
}
}
if (precalcChksum) {
@ -801,6 +807,20 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename)
fputs("FS_FILE_FLAGS_HEADER_PERSISTENT", struct_file);
flags_printed = 1;
}
if (flags & FS_FILE_FLAGS_HEADER_HTTPVER_1_1) {
if (flags_printed) {
fputs(" | ", struct_file);
}
fputs("FS_FILE_FLAGS_HEADER_HTTPVER_1_1", struct_file);
flags_printed = 1;
}
if (flags & FS_FILE_FLAGS_SSI) {
if (flags_printed) {
fputs(" | ", struct_file);
}
fputs("FS_FILE_FLAGS_SSI", struct_file);
flags_printed = 1;
}
if (!flags_printed) {
fputs("0", struct_file);
}

View File

@ -52,7 +52,7 @@ 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_HEADER_HTTPVER_1_1 0x04
#define FS_FILE_FLAGS_SSI 0x08
/** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private