Skip to content

Commit

Permalink
Fix #320 Stubby won't start without log_level setting
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Aug 19, 2022
1 parent 212e78d commit cf9e0f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 2022-08-19: version 0.4.2
* Fix Issue #320: Stubby doesn't start without "log_level"
entry. Thanks Johnny S. Lee

* 2022-08-19: Version 0.4.1
* Several updates to the servers in the config file:
* sinodun.dnsovertls*.com servers are removed and will be
Expand Down
10 changes: 8 additions & 2 deletions src/configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,21 @@ static getdns_return_t parse_config(getdns_context *context,
(void) getdns_dict_remove_name(
config_dict, "listen_addresses");
}
if (!(r = getdns_dict_get_int(
if (r)
; /* exit with current error */

else if (!(r = getdns_dict_get_int(
config_dict, "log_level", &config_log_level))) {
if (config_log_level > GETDNS_LOG_DEBUG)
stubby_error("log level '%d' from config file is invalid or out of range (0-7)", (int)config_log_level);
else
*log_level = config_log_level;
(void) getdns_dict_remove_name(
config_dict, "log_level");
}

} else if (r == GETDNS_RETURN_NO_SUCH_DICT_NAME)
r = GETDNS_RETURN_GOOD;

if (!r && (r = getdns_context_config(context, config_dict))) {
stubby_error("Could not configure context with "
"config dict: %s", stubby_getdns_strerror(r));
Expand Down

0 comments on commit cf9e0f5

Please sign in to comment.