"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/luabackend/supermaster.cc" between
pdns-auth-4.1.13.tar.gz and pdns-auth-4.2.0.tar.gz

About: PowerDNS Authoritative Nameserver is a versatile nameserver which supports a large number of backends (that can either be plain zone files or be more dynamic in nature).

supermaster.cc  (pdns-auth-4.1.13):supermaster.cc  (pdns-auth-4.2.0)
skipping to change at line 46 skipping to change at line 46
virtual bool createSlaveDomain(const string &ip, const string &domain, const s tring &nameserver, const string &account) virtual bool createSlaveDomain(const string &ip, const string &domain, const s tring &nameserver, const string &account)
*/ */
bool LUABackend::superMasterBackend(const string &ip, const DNSName &domain, con st vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBack end **db) { bool LUABackend::superMasterBackend(const string &ip, const DNSName &domain, con st vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBack end **db) {
if (f_lua_supermasterbackend == 0) if (f_lua_supermasterbackend == 0)
return false; return false;
if (logging) if (logging)
L << Logger::Info << backend_name << "(superMasterBackend) BEGIN" << endl ; g_log << Logger::Info << backend_name << "(superMasterBackend) BEGIN" << endl;
lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_supermasterbackend); lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_supermasterbackend);
lua_pushstring(lua, ip.c_str()); lua_pushstring(lua, ip.c_str());
lua_pushstring(lua, domain.toString().c_str()); lua_pushstring(lua, domain.toString().c_str());
lua_newtable(lua); lua_newtable(lua);
int c = 0; int c = 0;
for(vector<DNSResourceRecord>::const_iterator i=nsset.begin();i!=nsset.end() ;++i) { for(vector<DNSResourceRecord>::const_iterator i=nsset.begin();i!=nsset.end() ;++i) {
c++; c++;
skipping to change at line 99 skipping to change at line 99
if (returnedwhat == LUA_TSTRING) if (returnedwhat == LUA_TSTRING)
a = lua_tostring(lua, -1); a = lua_tostring(lua, -1);
lua_pop(lua, 1); lua_pop(lua, 1);
if (ok) { if (ok) {
*account = a; *account = a;
*db = this; *db = this;
} }
if (logging) if (logging)
L << Logger::Info << backend_name << "(superMasterBackend) END" << endl; g_log << Logger::Info << backend_name << "(superMasterBackend) END" << en dl;
return ok; return ok;
} }
bool LUABackend::createSlaveDomain(const string &ip, const DNSName& domain, cons t string &nameserver, const string &account) { bool LUABackend::createSlaveDomain(const string &ip, const DNSName& domain, cons t string &nameserver, const string &account) {
if (f_lua_createslavedomain == 0) if (f_lua_createslavedomain == 0)
return false; return false;
if (logging) if (logging)
L << Logger::Info << backend_name << "(createSlaveDomain) BEGIN" << endl; g_log << Logger::Info << backend_name << "(createSlaveDomain) BEGIN" << e ndl;
lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_createslavedomain); lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_createslavedomain);
lua_pushstring(lua, ip.c_str()); lua_pushstring(lua, ip.c_str());
lua_pushstring(lua, domain.toString().c_str()); lua_pushstring(lua, domain.toString().c_str());
lua_pushstring(lua, account.c_str()); lua_pushstring(lua, account.c_str());
if(lua_pcall(lua, 3, 1, f_lua_exec_error) != 0) { if(lua_pcall(lua, 3, 1, f_lua_exec_error) != 0) {
string e = backend_name + lua_tostring(lua, -1); string e = backend_name + lua_tostring(lua, -1);
lua_pop(lua, 1); lua_pop(lua, 1);
skipping to change at line 135 skipping to change at line 135
size_t returnedwhat = lua_type(lua, -1); size_t returnedwhat = lua_type(lua, -1);
bool ok = false; bool ok = false;
if (returnedwhat == LUA_TBOOLEAN) if (returnedwhat == LUA_TBOOLEAN)
ok = lua_toboolean(lua, -1); ok = lua_toboolean(lua, -1);
lua_pop(lua, 1); lua_pop(lua, 1);
if (logging) if (logging)
L << Logger::Info << backend_name << "(createSlaveDomain) END" << endl; g_log << Logger::Info << backend_name << "(createSlaveDomain) END" << end l;
return ok; return ok;
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)