diff --git a/examples/http-server/main.c b/examples/http-server/main.c index f5a8ba96..7b03f5e3 100644 --- a/examples/http-server/main.c +++ b/examples/http-server/main.c @@ -8,7 +8,6 @@ static const char *s_debug_level = "2"; static const char *s_root_dir = "."; static const char *s_listening_address = "http://localhost:8000"; static const char *s_enable_hexdump = "no"; -static const char *s_ssi_pattern = "#.shtml"; // Handle interrupts, like Ctrl-C static int s_signo; @@ -20,8 +19,8 @@ static void signal_handler(int signo) { // Simply serve static files from `s_root_dir` static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { if (ev == MG_EV_HTTP_MSG) { - struct mg_http_serve_opts opts = {.root_dir = s_root_dir, - .ssi_pattern = s_ssi_pattern}; + struct mg_http_serve_opts opts = {0}; + opts.root_dir = s_root_dir; mg_http_serve_dir(c, ev_data, &opts); } (void) fn_data; @@ -32,12 +31,11 @@ static void usage(const char *prog) { "Mongoose v.%s\n" "Usage: %s OPTIONS\n" " -H yes|no - enable traffic hexdump, default: '%s'\n" - " -S GLOB - glob pattern for SSI files, default: '%s'\n" " -d DIR - directory to serve, default: '%s'\n" " -l ADDR - listening address, default: '%s'\n" " -v LEVEL - debug level, from 0 to 4, default: '%s'\n", - MG_VERSION, prog, s_debug_level, s_enable_hexdump, s_ssi_pattern, - s_root_dir, s_listening_address); + MG_VERSION, prog, s_debug_level, s_enable_hexdump, s_root_dir, + s_listening_address); exit(EXIT_FAILURE); } @@ -52,8 +50,6 @@ int main(int argc, char *argv[]) { s_root_dir = argv[++i]; } else if (strcmp(argv[i], "-H") == 0) { s_enable_hexdump = argv[++i]; - } else if (strcmp(argv[i], "-S") == 0) { - s_ssi_pattern = argv[++i]; } else if (strcmp(argv[i], "-l") == 0) { s_listening_address = argv[++i]; } else if (strcmp(argv[i], "-v") == 0) {