Browse Source

untested http custom file handler

Thomas Buck 11 months ago
parent
commit
13ab874001
1 changed files with 25 additions and 0 deletions
  1. 25
    0
      src/http.c

+ 25
- 0
src/http.c View File

@@ -22,6 +22,31 @@
22 22
 #include "log.h"
23 23
 #include "http.h"
24 24
 
25
+
25 26
 void http_init(void) {
26 27
     httpd_init();
27 28
 }
29
+
30
+#ifdef DEBUG_DISK_WRITE_SOURCES
31
+
32
+#include "lwip/apps/fs.h"
33
+#include <string.h>
34
+#include "pack_data.h"
35
+
36
+int fs_open_custom(struct fs_file *file, const char *name) {
37
+    if (strcmp(name, "/src.tar.xz") == 0) {
38
+        memset(file, 0, sizeof(struct fs_file));
39
+        file->data = (const char *)data_tar_xz;
40
+        file->len = data_tar_xz_len;
41
+        file->index = file->len;
42
+        file->flags = FS_FILE_FLAGS_HEADER_PERSISTENT;
43
+        return 1;
44
+    }
45
+    return 0;
46
+}
47
+
48
+void fs_close_custom(struct fs_file *file) {
49
+    (void)file;
50
+}
51
+
52
+#endif // DEBUG_DISK_WRITE_SOURCES

Loading…
Cancel
Save