mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-27 12:26:24 +00:00
Remove debug logs
This commit is contained in:
1 parent
457d76b049
commit
ed1a98c381
2 files changed
+2
-10
No files matched your search
+1
-5
@@ -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);
|
||||
|
||||
+1
-5
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user