diff --git a/mongoose.c b/mongoose.c index ada38118..4ead56a1 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1020,7 +1020,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm, memcpy(c->send.buf + off - 10, tmp, n); // Set content length } else { mg_http_reply(c, 400, "", "Cannot open dir"); - LOG(LL_DEBUG, ("%lu opendir(%s) -> %d", c->id, dir, errno)); + LOG(LL_ERROR, ("%lu opendir(%s) -> %d", c->id, dir, errno)); } } #endif @@ -1033,8 +1033,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, if (realpath(opts->root_dir, t1) == NULL) LOG(LL_ERROR, ("realpath(%s): %d", opts->root_dir, errno)); - LOG(LL_DEBUG, ("realpath(%s) -> [%s] %zu", opts->root_dir, t1, sizeof(t1))); - if (!mg_is_dir(t1)) { mg_http_reply(c, 400, "", "Bad web root [%s]\n", t1); } else { @@ -1057,8 +1055,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, is_index = true; } - LOG(LL_DEBUG, (" --> [%s] [%s] %zu", t1, t2, sizeof(t1))); - if (strlen(t2) < n1 || memcmp(t1, t2, n1) != 0) { // Requested file is located outside root directory, fail mg_http_reply(c, 404, "", "Not found %.*s\n", hm->uri.len, hm->uri.ptr); diff --git a/src/http.c b/src/http.c index f0869a27..c758cb50 100644 --- a/src/http.c +++ b/src/http.c @@ -600,7 +600,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm, memcpy(c->send.buf + off - 10, tmp, n); // Set content length } else { mg_http_reply(c, 400, "", "Cannot open dir"); - LOG(LL_DEBUG, ("%lu opendir(%s) -> %d", c->id, dir, errno)); + LOG(LL_ERROR, ("%lu opendir(%s) -> %d", c->id, dir, errno)); } } #endif @@ -613,8 +613,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, if (realpath(opts->root_dir, t1) == NULL) LOG(LL_ERROR, ("realpath(%s): %d", opts->root_dir, errno)); - LOG(LL_DEBUG, ("realpath(%s) -> [%s] %zu", opts->root_dir, t1, sizeof(t1))); - if (!mg_is_dir(t1)) { mg_http_reply(c, 400, "", "Bad web root [%s]\n", t1); } else { @@ -637,8 +635,6 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, is_index = true; } - LOG(LL_DEBUG, (" --> [%s] [%s] %zu", t1, t2, sizeof(t1))); - if (strlen(t2) < n1 || memcmp(t1, t2, n1) != 0) { // Requested file is located outside root directory, fail mg_http_reply(c, 404, "", "Not found %.*s\n", hm->uri.len, hm->uri.ptr);