httpd: wrap fs_file::pextension in a config macro

see bug #59876
This commit is contained in:
Mike Kleshov 2021-01-28 08:29:25 +03:00
parent 89dca4588f
commit 69725292a0
2 changed files with 12 additions and 0 deletions

View File

@ -67,9 +67,11 @@ struct fs_file {
const char *data; const char *data;
int len; int len;
int index; int index;
#if LWIP_HTTPD_FILE_EXTENSION
/* pextension is free for implementations to hold private (extensional) /* pextension is free for implementations to hold private (extensional)
arbitrary data, e.g. holding some file state or file system handle */ arbitrary data, e.g. holding some file state or file system handle */
fs_file_extension *pextension; fs_file_extension *pextension;
#endif /* LWIP_HTTPD_FILE_EXTENSION */
#if HTTPD_PRECALCULATED_CHECKSUM #if HTTPD_PRECALCULATED_CHECKSUM
const struct fsdata_chksum *chksum; const struct fsdata_chksum *chksum;
u16_t chksum_count; u16_t chksum_count;

View File

@ -375,6 +375,16 @@
#define LWIP_HTTPD_FILE_STATE 0 #define LWIP_HTTPD_FILE_STATE 0
#endif #endif
/** Set this to 1 to add the pextension field to the fs_file structure.
* This is included here to retain compatibility with legacy code that
* relies on the presence of the pextension field.
* New code should use LWIP_HTTPD_FILE_STATE instead.
* This option may be removed in a future version of lwip.
*/
#if !defined LWIP_HTTPD_FILE_EXTENSION || defined __DOXYGEN__
#define LWIP_HTTPD_FILE_EXTENSION 0
#endif
/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for /** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for
* predefined (MSS-sized) chunks of the files to prevent having to calculate * predefined (MSS-sized) chunks of the files to prevent having to calculate
* the checksums at runtime. */ * the checksums at runtime. */