- For #52 #53, second context does not close logfile override.

This commit is contained in:
W.C.A. Wijngaards 2019-08-01 09:15:33 +02:00
parent fe0b1da859
commit e860d39f54
4 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,6 @@
1 August 2019: Wouter
- For #52 #53, second context does not close logfile override.
29 July 2019: Wouter
- Add verbose log message when auth zone file is written, at level 4.
- Add hex print of trust anchor pointer to trust anchor file temp

View File

@ -57,9 +57,16 @@ context_finalize(struct ub_ctx* ctx)
{
struct config_file* cfg = ctx->env->cfg;
verbosity = cfg->verbosity;
if(ctx->logfile_override)
if(ctx_logfile_overridden) {
log_file(NULL); /* clear that override */
ctx_logfile_overridden = 0;
}
if(ctx->logfile_override) {
ctx_logfile_overridden = 1;
log_file(ctx->log_out);
else log_init(cfg->logfile, cfg->use_syslog, NULL);
} else {
log_init(cfg->logfile, cfg->use_syslog, NULL);
}
config_apply(cfg);
if(!modstack_setup(&ctx->mods, cfg->module_conf, ctx->env))
return UB_INITFAIL;

View File

@ -52,6 +52,9 @@ struct tube;
struct sldns_buffer;
struct ub_event_base;
/** store that the logfile has a debug override */
extern int ctx_logfile_overridden;
/**
* The context structure
*

View File

@ -79,6 +79,9 @@
#include <iphlpapi.h>
#endif /* UB_ON_WINDOWS */
/** store that the logfile has a debug override */
int ctx_logfile_overridden = 0;
/** create context functionality, but no pipes */
static struct ub_ctx* ub_ctx_create_nopipe(void)
{
@ -328,8 +331,10 @@ ub_ctx_delete(struct ub_ctx* ctx)
ub_randfree(ctx->seed_rnd);
alloc_clear(&ctx->superalloc);
traverse_postorder(&ctx->queries, delq, NULL);
if(ctx->logfile_override)
if(ctx_logfile_overridden) {
log_file(NULL);
ctx_logfile_overridden = 0;
}
free(ctx);
#ifdef USE_WINSOCK
WSACleanup();