commit 6e5b538555a0da104cdce0480a721abca02f58b1 from: Omar Polo via: Thomas Adam date: Fri Jul 12 06:00:18 2024 UTC gotwebd: change how we deal with a non-existant config file We don't need a config file since we have some defaults, but we also need a way to set them. After the change to move `listen on' to a global rule, we don't add the default socket anymore when there's no config file. Instead, change how we deal with an *existing* config file and leave the rest of parse_function() to handle the case of missing knobs to set up. commit - 00862f7f5b5dddd0fa00b4b5c7e2827fdda53f99 commit + 6e5b538555a0da104cdce0480a721abca02f58b1 blob - 4c081b06b19f4927f374ee0ed69e3f67cd69e416 blob + b0f3611d62197317b09162c820b05d4b23c3557e --- gotwebd/parse.y +++ gotwebd/parse.y @@ -807,16 +807,12 @@ parse_config(const char *filename, struct gotwebd *env gotwebd = env; file = newfile(filename, 0); - if (file == NULL) { - add_default_server(); - sockets_parse_sockets(env); - /* just return, as we don't require a conf file */ - return (0); + if (file != NULL) { + /* we don't require a config file */ + yyparse(); + errors = file->errors; + closefile(file); } - - yyparse(); - errors = file->errors; - closefile(file); /* Free macros and check which have not been used. */ TAILQ_FOREACH_SAFE(sym, &symhead, entry, next) {