@@ -204,7 +204,7 @@ option during build time, use the `-D OPTION` compiler flag:
204204$ cc app0.c mongoose.c # Use defaults!
205205$ cc app1.c mongoose.c -D MG_ENABLE_IPV6=1 # Build with IPv6 enabled
206206$ cc app2.c mongoose.c -D MG_ARCH=MG_ARCH_FREERTOS_LWIP # Set architecture
207- $ cc app3.c mongoose.c -D MG_ENABLE_SSI=1 -D MG_ENABLE_LOG=0 # Multiple options
207+ $ cc app3.c mongoose.c -D MG_ENABLE_SSI=0 -D MG_ENABLE_LOG=0 # Multiple options
208208```
209209
210210The list of supported
@@ -240,12 +240,13 @@ Here is a list of build constants and their default values:
240240| MG_ENABLE_IPV6 | 0 | Enable IPv6 |
241241| MG_ENABLE_LOG | 1 | Enable ` LOG() ` macro |
242242| MG_ENABLE_MD5 | 0 | Use native MD5 implementation |
243- | MG_ENABLE_DIRECTORY_LISTING | 0 | Enable directory listing for HTTP server |
244243| MG_ENABLE_SOCKETPAIR | 0 | Enable ` mg_socketpair() ` for multi-threading |
245- | MG_ENABLE_SSI | 0 | Enable serving SSI files by ` mg_http_serve_dir() ` |
246- | MG_IO_SIZE | 512 | Granularity of the send/recv IO buffer growth |
244+ | MG_ENABLE_SSI | 1 | Enable serving SSI files by ` mg_http_serve_dir() ` |
245+ | MG_ENABLE_DIRLIST | 0 | Enable directory listing |
246+ | MG_IO_SIZE | 2048 | Granularity of the send/recv IO buffer growth |
247247| MG_MAX_RECV_BUF_SIZE | (3 * 1024 * 1024) | Maximum recv buffer size |
248248| MG_MAX_HTTP_HEADERS | 40 | Maximum number of HTTP headers |
249+ | MG_ENABLE_LINES | undefined | If defined, show source file names in logs |
249250
250251
251252NOTE: ` MG_IO_SIZE ` controls the maximum UDP message size, see
@@ -724,18 +725,20 @@ enable SSI, set a `-DMG_ENABLE_SSI=1` build flag.
724725
725726``` c
726727void mg_http_serve_file (struct mg_connection * , struct mg_http_message * hm,
727- const char * path, const char * mimetype,
728- const char * extra_headers);
728+ const char * path, struct mg_http_serve_opts * opts);
729729```
730730
731731Serve static file. Note that the `extra_headers` must end with `\r\n`. Here
732732is an example call:
733733
734734```c
735- mg_http_serve_file(c, hm, "a.png", "image/png", "AA: bb\r\nCC: dd\r\n");
735+ struct mg_http_serve_opts opts = {.mime_types = "png=image/png",
736+ .extra_headers = "AA: bb\r\nCC: dd\r\n"};
737+ mg_http_serve_file(c, hm, "a.png", &opts);
736738```
737739
738740
741+
739742### mg\_ http\_ reply()
740743
741744``` c
0 commit comments