diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-05-16 13:17:10 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-05-16 13:17:10 +0200 |
commit | 7a6811b705d6cca54b1367459fa19bb6d1234c45 (patch) | |
tree | 3f90fac787402d64510731eec4b0ec62b2af2096 /main.c | |
parent | a5b6d0f4211fe22e86175b58d59876c81bbd3886 (diff) |
uhttpd: allow the config to override the default index file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -165,7 +165,7 @@ static int usage(const char *name) return 1; } -static void init_defaults(void) +static void init_defaults_pre(void) { conf.script_timeout = 60; conf.network_timeout = 30; @@ -175,7 +175,10 @@ static void init_defaults(void) conf.realm = "Protected Area"; conf.cgi_prefix = "/cgi-bin"; conf.cgi_path = "/sbin:/usr/sbin:/bin:/usr/bin"; +} +static void init_defaults_post(void) +{ uh_index_add("index.html"); uh_index_add("index.htm"); uh_index_add("default.html"); @@ -213,7 +216,7 @@ int main(int argc, char **argv) BUILD_BUG_ON(sizeof(uh_buf) < PATH_MAX); uh_dispatch_add(&cgi_dispatch); - init_defaults(); + init_defaults_pre(); signal(SIGPIPE, SIG_IGN); while ((ch = getopt(argc, argv, "afSDRC:K:E:I:p:s:h:c:l:L:d:r:m:n:N:x:i:t:k:T:A:u:U:")) != -1) { @@ -402,6 +405,7 @@ int main(int argc, char **argv) } uh_config_parse(); + init_defaults_post(); if (!bound) { fprintf(stderr, "Error: No sockets bound, unable to continue\n"); |