Message ID | 1547280922-22728-1-git-send-email-james.hilliard1@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/1] webserver: fix postupdate default when not using a config file | expand |
Hi James, On 12/01/19 09:15, james.hilliard1@gmail.com wrote: > From: James Hilliard <james.hilliard1@gmail.com> > > We can't set the postupdate default in the mongoose_settings function > since mongoose_settings is only run when a config file is present, > instead we set it in start_mongoose before mongoose_settings is run. > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > mongoose/mongoose_interface.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c > index ef48c00..2ef3f6d 100644 > --- a/mongoose/mongoose_interface.c > +++ b/mongoose/mongoose_interface.c > @@ -492,10 +492,6 @@ static int mongoose_settings(void *elem, void __attribute__ ((__unused__)) *dat > if (strlen(tmp)) { > opts->auth_domain = strdup(tmp); > } > - /* > - * Default value is active > - */ > - run_postupdate = true; > get_field(LIBCFG_PARSER, elem, "run-postupdate", &run_postupdate); > > return 0; > @@ -556,6 +552,11 @@ int start_mongoose(const char *cfgfname, int argc, char *argv[]) > /* No listing directory as default */ > opts.listing = false; > > + /* > + * Default value is active > + */ > + run_postupdate = true; > + > if (cfgfname) { > read_module_settings(cfgfname, "webserver", mongoose_settings, &opts); > } > Acked-by: stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c index ef48c00..2ef3f6d 100644 --- a/mongoose/mongoose_interface.c +++ b/mongoose/mongoose_interface.c @@ -492,10 +492,6 @@ static int mongoose_settings(void *elem, void __attribute__ ((__unused__)) *dat if (strlen(tmp)) { opts->auth_domain = strdup(tmp); } - /* - * Default value is active - */ - run_postupdate = true; get_field(LIBCFG_PARSER, elem, "run-postupdate", &run_postupdate); return 0; @@ -556,6 +552,11 @@ int start_mongoose(const char *cfgfname, int argc, char *argv[]) /* No listing directory as default */ opts.listing = false; + /* + * Default value is active + */ + run_postupdate = true; + if (cfgfname) { read_module_settings(cfgfname, "webserver", mongoose_settings, &opts); }