From 9930e0ebca8ba470be59b4e0c56c7415882ee075 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 5 Jan 2015 14:21:39 +0100 Subject: [PATCH] rename prequery to preoutquery, remove a duplicate *duplicate* prequery from example script --- pdns/lua-recursor.cc | 8 ++++---- pdns/lua-recursor.hh | 2 +- pdns/powerdns-example-script.lua | 13 +------------ pdns/syncres.cc | 2 +- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/pdns/lua-recursor.cc b/pdns/lua-recursor.cc index be8a5b66c..65b7fc10d 100644 --- a/pdns/lua-recursor.cc +++ b/pdns/lua-recursor.cc @@ -32,7 +32,7 @@ bool RecursorLua::preresolve(const ComboAddress& remote, const ComboAddress& loc return false; } -bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector& ret, int& res) +bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector& ret, int& res) { return false; } @@ -160,9 +160,9 @@ bool RecursorLua::postresolve(const ComboAddress& remote, const ComboAddress& lo return passthrough("postresolve", remote, local, query, qtype, ret, res, variable); } -bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector& ret, int& res) +bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector& ret, int& res) { - return passthrough("prequery", remote, local, query, qtype, ret, res, 0); + return passthrough("preoutquery", remote, local, query, qtype, ret, res, 0); } @@ -180,7 +180,7 @@ bool RecursorLua::passthrough(const string& func, const ComboAddress& remote, co d_local = local; /* the first argument */ - if(strcmp(func.c_str(),"prequery")) + if(strcmp(func.c_str(),"preoutquery")) lua_pushstring(d_lua, remote.toString().c_str() ); else { ComboAddress* ca=(ComboAddress*)lua_newuserdata(d_lua, sizeof(ComboAddress)); diff --git a/pdns/lua-recursor.hh b/pdns/lua-recursor.hh index 9dee98816..039fa704e 100644 --- a/pdns/lua-recursor.hh +++ b/pdns/lua-recursor.hh @@ -13,7 +13,7 @@ public: bool nxdomain(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector& res, int& ret, bool* variable); bool nodata(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector& res, int& ret, bool* variable); bool postresolve(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector& res, int& ret, bool* variable); - bool prequery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector& res, int& ret); + bool preoutquery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector& res, int& ret); private: bool passthrough(const string& func, const ComboAddress& remote,const ComboAddress& local, const string& query, const QType& qtype, vector& ret, int& res, bool* variable); diff --git a/pdns/powerdns-example-script.lua b/pdns/powerdns-example-script.lua index d168c5fdc..f0dec949a 100644 --- a/pdns/powerdns-example-script.lua +++ b/pdns/powerdns-example-script.lua @@ -159,21 +159,10 @@ function hidettl ( remoteip, domain, qtype, records, origrcode ) return origrcode, records end -function prequery(remoteip, domain, qtype) - print("pdns wants to ask "..remoteip.." about "..domain.." "..qtype) - if(remoteip=="192.121.121.14") - then - return -3,{} - else - return -1,{} - end -end - - nmg=iputils.newnmgroup() nmg:add("192.121.121.0/24") -function prequery(remoteip, domain, qtype) +function preoutquery(remoteip, domain, qtype) print("pdns wants to ask "..remoteip:tostring().." about "..domain.." "..qtype) if(nmg:match(remoteip)) then diff --git a/pdns/syncres.cc b/pdns/syncres.cc index c351534b8..f2af138e5 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -933,7 +933,7 @@ int SyncRes::doResolveAt(set nameservers, string auth, s_tcpoutqueries++; d_tcpoutqueries++; } - if(d_pdl && d_pdl->prequery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) { + if(d_pdl && d_pdl->preoutquery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) { LOG(prefix<