You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a side-note, the naming convention of these functions is somewhat confusing. The first function implicitly reads from a lwan configuration file (with the same name as the binary being run). The second allows you to pass a configuration struct, and therefore should allow for not needing a configuration file to be present.
Unfortunately, using lwan_init_with_config() does not escape the need for a configuration file. Lwan still requires a minimal config file when using this function, roughly:
listener *:8080 {}
Ideally, using lwan_init_with_config() should escape any need for a configuration file. Perhaps a configuration file, if one is present, should still be honored (though I am unsure if that's actually preferable), but it certainly should not be required.
It looks like the specific culprit here is try_setup_with_config() (reproduced below for ease):
staticvoidtry_setup_from_config(structlwan*l, conststructlwan_config*config)
{
if (!setup_from_config(l, config->config_file_path)) {
if (config->config_file_path) {
lwan_status_critical("Could not read config file: %s",
config->config_file_path);
}
}
/* `quiet` key might have changed value. */lwan_status_init(l);
}
I am hoping this can be modified such that if config != &default_config, it skips the check for the config file path. Does that sound reasonable? Are there any assumptions I am making which mean this needs to be done in a different way or that this cannot be done at all?
The text was updated successfully, but these errors were encountered:
At the moment, there are two init functions:
lwan_init()
lwan_init_with_config()
As a side-note, the naming convention of these functions is somewhat confusing. The first function implicitly reads from a lwan configuration file (with the same name as the binary being run). The second allows you to pass a configuration struct, and therefore should allow for not needing a configuration file to be present.
Unfortunately, using
lwan_init_with_config()
does not escape the need for a configuration file. Lwan still requires a minimal config file when using this function, roughly:Ideally, using
lwan_init_with_config()
should escape any need for a configuration file. Perhaps a configuration file, if one is present, should still be honored (though I am unsure if that's actually preferable), but it certainly should not be required.It looks like the specific culprit here is
try_setup_with_config()
(reproduced below for ease):I am hoping this can be modified such that if
config != &default_config
, it skips the check for the config file path. Does that sound reasonable? Are there any assumptions I am making which mean this needs to be done in a different way or that this cannot be done at all?The text was updated successfully, but these errors were encountered: