From: Peter van Dijk Date: Tue, 5 Nov 2013 13:02:59 +0000 (+0100) Subject: move variable definitions up to allow goto X-Git-Tag: rec-3.6.0-rc1~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=904d32197f18b7725f3211039a2891389b78533e;p=thirdparty%2Fpdns.git move variable definitions up to allow goto --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3d300257af..84a70937ce 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -513,13 +513,17 @@ void startDoResolve(void *p) pw.getHeader()->id=dc->d_mdp.d_header.id; pw.getHeader()->rd=dc->d_mdp.d_header.rd; + uint32_t minTTL=std::numeric_limits::max(); + + SyncRes sr(dc->d_now); + bool tracedQuery=false; // we could consider letting Lua know about this too + bool variableAnswer = false; + if(dc->d_mdp.d_qtype==QType::ANY && !dc->d_tcp && g_anyToTcp) { pw.getHeader()->tc=1; goto sendit; } - SyncRes sr(dc->d_now); - bool tracedQuery=false; // we could consider letting Lua know about this too if(t_traceRegex->get() && (*t_traceRegex)->match(dc->d_mdp.d_qname)) { sr.setLogMode(SyncRes::Store); tracedQuery=true; @@ -535,7 +539,6 @@ void startDoResolve(void *p) int res; - bool variableAnswer = false; // if there is a RecursorLua active, and it 'took' the query in preResolve, we don't launch beginResolve if(!t_pdl->get() || !(*t_pdl)->preresolve(dc->d_remote, g_listenSocketsAddresses[dc->d_socket], dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), ret, res, &variableAnswer)) { res = sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_mdp.d_qclass, ret); @@ -556,7 +559,6 @@ void startDoResolve(void *p) } } - uint32_t minTTL=std::numeric_limits::max(); if(tracedQuery || res < 0 || res == RCode::ServFail || pw.getHeader()->rcode == RCode::ServFail) {