mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
Remove -r option
This commit is contained in:
1 parent
c7e09bd7b4
commit
2c1324dc0a
1 file changed
+6
-8
@@ -4,15 +4,14 @@
|
|||||||
#include "mongoose.h"
|
#include "mongoose.h"
|
||||||
|
|
||||||
static const char *s_debug_level = "2";
|
static const char *s_debug_level = "2";
|
||||||
static const char *s_web_root_dir = ".";
|
static const char *s_root_dir = ".";
|
||||||
static const char *s_listening_address = "http://localhost:8000";
|
static const char *s_listening_address = "http://localhost:8000";
|
||||||
static const char *s_enable_hexdump = "no";
|
static const char *s_enable_hexdump = "no";
|
||||||
static const char *s_rewrites = "";
|
|
||||||
static const char *s_ssi_pattern = "#.shtml";
|
static const char *s_ssi_pattern = "#.shtml";
|
||||||
|
|
||||||
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||||
if (ev == MG_EV_HTTP_MSG) {
|
if (ev == MG_EV_HTTP_MSG) {
|
||||||
struct mg_http_serve_opts opts = {.root_dir = s_web_root_dir,
|
struct mg_http_serve_opts opts = {.root_dir = s_root_dir,
|
||||||
.ssi_pattern = s_ssi_pattern};
|
.ssi_pattern = s_ssi_pattern};
|
||||||
mg_http_serve_dir(c, ev_data, &opts);
|
mg_http_serve_dir(c, ev_data, &opts);
|
||||||
}
|
}
|
||||||
@@ -27,10 +26,9 @@ static void usage(const char *prog) {
|
|||||||
" -H yes|no - enable traffic hexdump, default: '%s'\n"
|
" -H yes|no - enable traffic hexdump, default: '%s'\n"
|
||||||
" -S GLOB - glob pattern for SSI files, default: '%s'\n"
|
" -S GLOB - glob pattern for SSI files, default: '%s'\n"
|
||||||
" -d DIR - directory to serve, default: '%s'\n"
|
" -d DIR - directory to serve, default: '%s'\n"
|
||||||
" -l ADDR - listening address, default: '%s'\n"
|
" -l ADDR - listening address, default: '%s'\n" MG_VERSION,
|
||||||
" -r LIST - list of URI=DIR,... URI rewrites, default: '%s'\n",
|
prog, s_debug_level, s_enable_hexdump, s_ssi_pattern, s_root_dir,
|
||||||
MG_VERSION, prog, s_debug_level, s_enable_hexdump, s_ssi_pattern,
|
s_listening_address);
|
||||||
s_web_root_dir, s_listening_address, s_rewrites);
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +40,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// Parse command-line flags
|
// Parse command-line flags
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "-d") == 0) {
|
if (strcmp(argv[i], "-d") == 0) {
|
||||||
s_web_root_dir = argv[++i];
|
s_root_dir = argv[++i];
|
||||||
} else if (strcmp(argv[i], "-D") == 0) {
|
} else if (strcmp(argv[i], "-D") == 0) {
|
||||||
s_debug_level = argv[++i];
|
s_debug_level = argv[++i];
|
||||||
} else if (strcmp(argv[i], "-H") == 0) {
|
} else if (strcmp(argv[i], "-H") == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user