From cd223885ebd7e40e2886fe8555581b8313b8d022 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 24 Jul 2015 11:44:58 +0000 Subject: [PATCH] And fix reponse generation when reducing the number of threads. git-svn-id: file:///svn/unbound/trunk@3457 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/daemon.c b/daemon/daemon.c index 386860624..75202e2c3 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -399,6 +399,12 @@ daemon_create_workers(struct daemon* daemon) verbose(VERB_ALGO, "total of %d outgoing ports available", numport); daemon->num = (daemon->cfg->num_threads?daemon->cfg->num_threads:1); + if(daemon->reuseport && (int)daemon->num < (int)daemon->num_ports) { + log_warn("cannot reduce num-threads to %d because so-reuseport " + "so continuing with %d threads.", (int)daemon->num, + (int)daemon->num_ports); + daemon->num = daemon->num_ports; + } daemon->workers = (struct worker**)calloc((size_t)daemon->num, sizeof(struct worker*)); if(daemon->cfg->dnstap) { -- 2.47.2