From: Pieter Lexis Date: Mon, 23 Nov 2015 11:06:49 +0000 (+0100) Subject: pipe: Correctly initialize the abi-version var X-Git-Tag: dnsdist-1.0.0-alpha1~204^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=783b9f8e47ecfd7673f2e079113329834691f031;p=pdns pipe: Correctly initialize the abi-version var Closes #2921 (thanks @paddg)! --- diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index e08a4592b..6405e9cb7 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -30,12 +30,12 @@ static const char *kBackendId = "[PIPEBackend]"; -CoWrapper::CoWrapper(const string &command, int timeout) +CoWrapper::CoWrapper(const string &command, int timeout, int abiVersion) { d_cp=0; d_command=command; d_timeout=timeout; - d_abiVersion = ::arg().asNum("pipebackend-abi-version"); + d_abiVersion = abiVersion; launch(); // let exceptions fall through - if initial launch fails, we want to die // I think } @@ -96,7 +96,7 @@ PipeBackend::PipeBackend(const string &suffix) signal(SIGCHLD, SIG_IGN); setArgPrefix("pipe"+suffix); try { - d_coproc=shared_ptr(new CoWrapper(getArg("command"), getArgAsNum("timeout"))); + d_coproc=shared_ptr(new CoWrapper(getArg("command"), getArgAsNum("timeout"), getArgAsNum("abi-version"))); d_regex=getArg("regex").empty() ? 0 : new Regex(getArg("regex")); d_regexstr=getArg("regex"); d_abiVersion = getArgAsNum("abi-version"); @@ -128,11 +128,11 @@ void PipeBackend::lookup(const QType& qtype,const DNSName& qname, DNSPacket *pkt realRemote = pkt_p->getRealRemote(); remoteIP = pkt_p->getRemote(); } - // pipebackend-abi-version = 1 + // abi-version = 1 // type qname qclass qtype id remote-ip-address query<<"Q\t"<= 2) query<<"\t"<= 3) diff --git a/modules/pipebackend/pipebackend.hh b/modules/pipebackend/pipebackend.hh index 962fc4660..f3053b8c8 100644 --- a/modules/pipebackend/pipebackend.hh +++ b/modules/pipebackend/pipebackend.hh @@ -20,7 +20,7 @@ class CoWrapper { public: - CoWrapper(const string &command, int timeout=0); + CoWrapper(const string &command, int timeout, int abiVersion); ~CoWrapper(); void send(const string &line); void receive(string &line); diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index bbd22c668..a4c7748dc 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -117,7 +117,6 @@ static int shorthand2algorithm(const string &algorithm) void loadMainConfig(const std::string& configdir) { ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=configdir; - ::arg().set("pipebackend-abi-version","Version of the pipe backend ABI")="1"; ::arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600"; ::arg().set("launch","Which backends to launch"); ::arg().set("dnssec","if we should do dnssec")="true";