[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #59876] HTTPD FS: in struct fs_file, pextension duplic
From: |
Mike Kleshov |
Subject: |
[lwip-devel] [bug #59876] HTTPD FS: in struct fs_file, pextension duplicates LWIP_HTTPD_FILE_STATE functionality |
Date: |
Wed, 27 Jan 2021 11:58:31 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0 |
Follow-up Comment #3, bug #59876 (project lwip):
Here is the proposed change:
--- a/src/include/lwip/apps/fs.h
+++ b/src/include/lwip/apps/fs.h
@@ -67,9 +67,11 @@
struct fs_file {
const char *data;
int len;
int index;
+#if LWIP_HTTPD_FILE_EXTENSION
/* pextension is free for implementations to hold private (extensional)
arbitrary data, e.g. holding some file state or file system handle */
fs_file_extension *pextension;
+#endif /* LWIP_HTTPD_FILE_EXTENSION */
#if HTTPD_PRECALCULATED_CHECKSUM
const struct fsdata_chksum *chksum;
u16_t chksum_count;
--- a/src/include/lwip/apps/httpd_opts.h
+++ b/src/include/lwip/apps/httpd_opts.h
@@ -375,6 +375,16 @@
#define LWIP_HTTPD_FILE_STATE 0
#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
* predefined (MSS-sized) chunks of the files to prevent having to calculate
* the checksums at runtime. */
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?59876>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/