mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-09-26 02:33:38 +08:00
httpd: remove fs_file::is_custom_file, use fs_file::flags instead
This commit is contained in:
@@ -64,10 +64,9 @@ fs_open(struct fs_file *file, const char *name)
|
||||
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (fs_open_custom(file, name)) {
|
||||
file->is_custom_file = 1;
|
||||
file->flags |= FS_FILE_FLAGS_CUSTOM;
|
||||
return ERR_OK;
|
||||
}
|
||||
file->is_custom_file = 0;
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
|
||||
for (f = FS_ROOT; f != NULL; f = f->next) {
|
||||
@@ -96,7 +95,7 @@ void
|
||||
fs_close(struct fs_file *file)
|
||||
{
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (file->is_custom_file) {
|
||||
if ((file->flags & FS_FILE_FLAGS_CUSTOM) != 0) {
|
||||
fs_close_custom(file);
|
||||
}
|
||||
#endif /* LWIP_HTTPD_CUSTOM_FILES */
|
||||
@@ -124,7 +123,7 @@ fs_read(struct fs_file *file, char *buffer, int count)
|
||||
LWIP_UNUSED_ARG(callback_arg);
|
||||
#endif /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (file->is_custom_file) {
|
||||
if ((file->flags & FS_FILE_FLAGS_CUSTOM) != 0) {
|
||||
#if LWIP_HTTPD_FS_ASYNC_READ
|
||||
return fs_read_async_custom(file, buffer, count, callback_fn, callback_arg);
|
||||
#else /* LWIP_HTTPD_FS_ASYNC_READ */
|
||||
|
||||
@@ -2379,7 +2379,7 @@ http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const cha
|
||||
hs->file = file->data;
|
||||
LWIP_ASSERT("File length must be positive!", (file->len >= 0));
|
||||
#if LWIP_HTTPD_CUSTOM_FILES
|
||||
if (file->is_custom_file && (file->data == NULL)) {
|
||||
if (((file->flags & FS_FILE_FLAGS_CUSTOM) != 0) && (file->data == NULL)) {
|
||||
/* custom file, need to read data first (via fs_read_custom) */
|
||||
hs->left = 0;
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user