commit 75e58d893ea728a250b35dff13d82123aaabc9f0 from: Omar Polo date: Mon Jul 08 16:26:58 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 - a0c23862a7804dbba0e030bd78bf05ed4d1ffdfe commit + 75e58d893ea728a250b35dff13d82123aaabc9f0 blob - 645aee63addc029fccb841ae1421a6184d3e0877 blob + 49ec87a86c055c8ed01ee091298ec92fa9dd8973 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -806,16 +806,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) {