Browse Source

fix: NULL process in debug mode

dev
Dnomd343 2 years ago
parent
commit
394ef26210
  1. 9
      src/cleardns.c
  2. 1
      src/loader/loader.c

9
src/cleardns.c

@ -52,14 +52,19 @@ int main(int argc, char *argv[]) { // ClearDNS service
load_config(config_file); load_config(config_file);
free(config_file); free(config_file);
if (LOG_LEVEL == LOG_DEBUG) { // debug mode enabled if (LOG_LEVEL == LOG_DEBUG) { // debug mode enabled
loader.filter->debug = TRUE;
loader.diverter->debug = TRUE; loader.diverter->debug = TRUE;
loader.domestic->debug = TRUE; loader.domestic->debug = TRUE;
loader.foreign->debug = TRUE; loader.foreign->debug = TRUE;
loader.crond->debug = TRUE; if (loader.crond != NULL) {
loader.crond->debug = TRUE;
}
if (loader.filter != NULL) {
loader.filter->debug = TRUE;
}
} }
process_list_init(); process_list_init();
log_info("Start loading process");
assets_load(loader.resource); assets_load(loader.resource);
process_list_append(dnsproxy_load("Domestic", loader.domestic, "domestic.json")); process_list_append(dnsproxy_load("Domestic", loader.domestic, "domestic.json"));
process_list_append(dnsproxy_load("Foreign", loader.foreign, "foreign.json")); process_list_append(dnsproxy_load("Foreign", loader.foreign, "foreign.json"));

1
src/loader/loader.c

@ -141,6 +141,7 @@ void load_config(const char *config_file) { // parser and load cleardns configur
log_info("Loading configure options"); log_info("Loading configure options");
if (!config->adguard.enable) { if (!config->adguard.enable) {
config->diverter.port = config->port; // override diverter port by dns port config->diverter.port = config->port; // override diverter port by dns port
log_warn("Diverter port change -> %u", config->diverter.port);
} }
loader.domestic = load_domestic(config); loader.domestic = load_domestic(config);

Loading…
Cancel
Save