From 8652006aeab06183cb4eecf70af0914079ff8ea7 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 20 Sep 2021 12:26:09 +0100 Subject: [PATCH] Remove dead code --- mongoose.c | 9 --------- src/http.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/mongoose.c b/mongoose.c index d864175f..6530a93c 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1512,12 +1512,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, struct mg_http_serve_opts *opts) { char path[MG_PATH_MAX] = ""; const char *sp = opts->ssi_pattern; -#if 0 - struct mg_fs *fs = opts->fs == NULL ? &mg_fs_posix : opts->fs; - if ((fs->stat(opts->root_dir, NULL, NULL) & MG_FS_DIR) == 0) { - mg_http_reply(c, 400, "", "Invalid web root [%s]\n", opts->root_dir); - } else { -#endif int flags = uri_to_path(c, hm, opts, path, sizeof(path)); if (flags == 0) return; LOG(LL_DEBUG, ("%.*s %s %d", (int) hm->uri.len, hm->uri.ptr, path, flags)); @@ -1528,9 +1522,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, } else { mg_http_serve_file(c, hm, path, opts); } -#if 0 - } -#endif } static bool mg_is_url_safe(int c) { diff --git a/src/http.c b/src/http.c index d7c720f9..2727d634 100644 --- a/src/http.c +++ b/src/http.c @@ -762,12 +762,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, struct mg_http_serve_opts *opts) { char path[MG_PATH_MAX] = ""; const char *sp = opts->ssi_pattern; -#if 0 - struct mg_fs *fs = opts->fs == NULL ? &mg_fs_posix : opts->fs; - if ((fs->stat(opts->root_dir, NULL, NULL) & MG_FS_DIR) == 0) { - mg_http_reply(c, 400, "", "Invalid web root [%s]\n", opts->root_dir); - } else { -#endif int flags = uri_to_path(c, hm, opts, path, sizeof(path)); if (flags == 0) return; LOG(LL_DEBUG, ("%.*s %s %d", (int) hm->uri.len, hm->uri.ptr, path, flags)); @@ -778,9 +772,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, } else { mg_http_serve_file(c, hm, path, opts); } -#if 0 - } -#endif } static bool mg_is_url_safe(int c) {