Here is a patch for the luabackend.

-- 
//fredan
Index: test/powerdns-luabackend.lua
===================================================================
--- test/powerdns-luabackend.lua	(revision 2261)
+++ test/powerdns-luabackend.lua	(arbetskopia)
@@ -32,8 +32,10 @@
 
 records["www.test.com"] = { {domain_id = 11, name = "www.test.com", type = "CNAME", ttl = 120, content = "host.test.com"} }
 records["host.test.com"] = {
-    {domain_id = 11, name = "host.test.com", type = "A", ttl = 120, content = "10.11.12.13"},
-    {domain_id = 11, name = "host.test.com", type = "AAAA", ttl = 120, content = "1:2:3:4:5:6:7:8"}
+--    {domain_id = 11, name = "host.test.com", type = "A", ttl = 120, content = "10.11.12.13"},
+--    {domain_id = 11, name = "host.test.com", type = "AAAA", ttl = 120, content = "1:2:3:4:5:6:7:8"},
+    {domain_id = 11, name = "host.test.com", type = "A", ttl = 120, content = "10.11.12.16"},
+    {domain_id = 11, name = "host.test.com", type = "AAAA", ttl = 120, content = "1:2:3:4:5:6:7:11"}
 }
 
 
Index: luabackend.hh
===================================================================
--- luabackend.hh	(revision 2261)
+++ luabackend.hh	(arbetskopia)
@@ -52,6 +52,7 @@
     bool isMaster(const string &name, const string &ip);
     void getUnfreshSlaveInfos(vector<DomainInfo>* domains);
     void setFresh(int id);
+    void setFresh(uint32_t id, uint32_t refresh);
 
     bool startTransaction(const string &qname, int id);
     bool commitTransaction();
@@ -150,8 +151,6 @@
     int f_lua_updatednssecorderandauth;
 
 
-//    int my_lua_panic (lua_State *lua);
-
 //  FUNCTIONS TO THIS BACKEND
     bool getValueFromTable(lua_State *lua, const std::string& key, string& value);
     bool getValueFromTable(lua_State *lua, uint32_t key, string& value);
@@ -176,54 +175,6 @@
     //dnssec.cc
     bool updateDomainKey(const string& name, unsigned int &id, bool toowhat);
 
-
-/*
-    //minimal.cc
-    bool content(DNSResourceRecord* rr);
-    
-    void getTheFreshOnes(vector<DomainInfo>* domains, string *type, string *f_name);
-    bool checkDomainInfo(const string *domain, mongo::BSONObj *mongo_r, string *f_name, string *mongo_q, DomainInfo *di, SOAData *soadata = NULL);
-    
-    
-    //crc32.cc
-    int generateCRC32(const string& my_string);
-    
-    string mongo_db;
-    string collection_domains;
-    string collection_records;
-
-    string collection_domainmetadata;
-    string collection_cryptokeys;
-    string collection_tsigkeys;
-
-    mongo::DBClientConnection m_db;
-    
-    auto_ptr<mongo::DBClientCursor> cursor;
-    
-    string q_name;
-    
-//    long long unsigned int count;
-    mongo::Query mongo_query;
-    mongo::BSONObj mongo_record;
-    bool elements;
-    DNSResourceRecord rr_record;
-    string type;
-    mongo::BSONObjIterator* contents;
-    
-    
-    
-    unsigned int default_ttl;
-
-    bool logging_cerr;
-    bool logging_content;
-
-    bool checkindex;
-
-    bool use_default_ttl;
-    
-    bool axfr_soa;
-    SOAData last_soadata;
-*/    
 };
 
 #endif 
Index: slave.cc
===================================================================
--- slave.cc	(revision 2261)
+++ slave.cc	(arbetskopia)
@@ -167,6 +167,11 @@
 
 void LUABackend::setFresh(int id) {
     
+    setFresh(id, 0);
+}
+
+void LUABackend::setFresh(uint32_t id, uint32_t refresh) {
+
     if (f_lua_setfresh == 0)
         return;
 
@@ -176,8 +181,9 @@
     lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_setfresh);
 
     lua_pushnumber(lua, id);
+    lua_pushnumber(lua, refresh);
 
-    if(lua_pcall(lua, 1, 0, f_lua_exec_error) != 0) {
+    if(lua_pcall(lua, 2, 0, f_lua_exec_error) != 0) {
         string e = backend_name + lua_tostring(lua, -1);
         lua_pop(lua, 1);
 
@@ -187,7 +193,6 @@
 
     if (logging)
 	L << Logger::Info << backend_name << "(setFresh) END" << endl;
-
 }
 
 void LUABackend::getUnfreshSlaveInfos(vector<DomainInfo>* domains) {
_______________________________________________
Pdns-users mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to