]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
cleanup luabackend comments
authortcely <tcely@users.noreply.github.com>
Tue, 1 Aug 2017 00:52:54 +0000 (20:52 -0400)
committertcely <tcely@users.noreply.github.com>
Thu, 24 May 2018 15:29:28 +0000 (11:29 -0400)
modules/luabackend/lua_functions.cc
modules/luabackend/lua_functions.hh
modules/luabackend/luabackend.hh
modules/luabackend/minimal.cc
modules/luabackend/reload.cc
modules/luabackend/slave.cc
modules/luabackend/supermaster.cc

index cd57a0074539f5c7d959d6d1b5e4d8225a11c4b4..c33ba5c0314173095e0cad15383415be8b2637c6 100644 (file)
@@ -50,13 +50,15 @@ const luaL_Reg lualibs[] = {
     {LUA_STRLIBNAME, luaopen_string},
     {LUA_MATHLIBNAME, luaopen_math},
     {LUA_DBLIBNAME, luaopen_debug},
+#if LUA_VERSION_NUM >= 502
+    //{LUA_COLIBNAME, luaopen_coroutine},
+#endif
 #if LUA_VERSION_NUM == 502 || defined(LUA_COMPAT_BITLIB)
     {LUA_BITLIBNAME, luaopen_bit32},
 #endif
 #if LUA_VERSION_NUM == 503
     {LUA_UTF8LIBNAME, luaopen_utf8},
 #endif
-//    {LUA_COLIBNAME, luaopen_coroutine},
 #ifdef USE_LUAJIT
     {"bit",     luaopen_bit},
     {"jit",     luaopen_jit},
@@ -134,7 +136,6 @@ int l_dnspacket (lua_State *lua) {
 }
 
 int l_logger (lua_State *lua) {
-//    assert(lua == lb->lua);
 
     int i = lua_gettop(lua);
     if (i < 1)
index eb95d242351cde9918326c990987a1bfc67c2cbb..6f65d7eefe3bccdd1f3f639e5f2771c058e57e94 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef LUABACKEND_EXTERN_F_HH
 #define LUABACKEND_EXTERN_F_HH
 
-//extern LUABackend* lb;
 extern int my_lua_panic(lua_State* lua);
 extern void register_lua_functions(lua_State* lua);
 
index d85cf91cacdfdfc2344e5436c2225ad273828009..308c194eb76f021e5a9d3845fd091b31089336fc 100644 (file)
 
 #include "lua.hpp"
 
-//extern "C" {
-//#include "lua.h"
-//#include "lualib.h"
-//#include "lauxlib.h"
-//}
-
 #include "pdns/dnsbackend.hh"
 
 #include <string>
 using std::string;
 
 
-
-
 class LUAException {
 public:
   LUAException(const string &ex) : what(ex){}
@@ -101,6 +93,8 @@ public:
     bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
     bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t qtype=QType::ANY) override;
     bool updateDNSSECOrderAndAuth(uint32_t domain_id, const DNSName& zonename, const DNSName& qname, bool auth);
+
+
 //  OTHER
     void reload() override ;
     void rediscover(string* status=0) override ;
@@ -167,8 +161,6 @@ private:
     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, const std::string& key, DNSName& value);
@@ -196,55 +188,6 @@ private:
 
     //dnssec.cc
     bool updateDomainKey(const DNSName& 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 9cc0bf63e4608ae2e9324034b79d76e7eef35ede..cf3545ee805ca2935bb2132ec8baacf767b6d725 100644 (file)
@@ -28,8 +28,6 @@
 #include "pdns/logger.hh"
 #include "pdns/arguments.hh"
 
-//#include "lua_functions.hh"
-
 /* FIRST PART */
 
 LUABackend::LUABackend(const string &suffix) {
@@ -45,7 +43,6 @@ LUABackend::LUABackend(const string &suffix) {
            backend_pid = pthread_self();
        }
 
-//     lb = NULL;
        lua = NULL;
        dnspacket = NULL;
        dnssec = false;
@@ -108,7 +105,6 @@ void LUABackend::lookup(const QType &qtype, const DNSName &qname, DNSPacket *p,
 
     lua_rawgeti(lua, LUA_REGISTRYINDEX, f_lua_lookup);
 
-//    lua_pushnumber(lua, qtype.getCode());
     lua_pushstring(lua, qtype.getName().c_str());
     lua_pushstring(lua, qname.toString().       c_str());
     lua_pushinteger(lua, domain_id);
@@ -151,7 +147,6 @@ bool LUABackend::get(DNSResourceRecord &rr) {
 
     rr.content.clear();
 
-//    uint16_t qt;
     string qt;
 
     if (getValueFromTable(lua, "type", qt) )
index 1dc8eaa471b70f0061efcf89f318a1fb5c144a7e..2bc2696ac71e222aa10e7a4bcf21a0f31bbd87c0 100644 (file)
@@ -34,11 +34,6 @@ using namespace std;
 
 #include "lua_functions.hh"
 
-/* 
-    virtual void reload();
-    virtual void rediscover(string* status=0);
-*/
-
 void LUABackend::get_lua_function(lua_State *lua, const char *name, int *function) {
     *function = 0;
     
@@ -61,7 +56,6 @@ void LUABackend::reload() {
     
     backend_name.clear();
 
-//     backend_name = "[LUABackend: " + uitoa(backend_pid) + " (" + uitoa(backend_count) +")] ";
     backend_name = "[LUABackend: (" + uitoa(backend_count) +")] ";
     
     if (lua)
index 1d61fff00a3b63d537493ea1eef6ce0399a68024..d7752e22e3bab0a1e17a9878714e32273049fcf5 100644 (file)
 #include "pdns/logger.hh"
 #include "pdns/arguments.hh"
 
-/* 
-    
-   virtual bool startTransaction(const string &qname, int id);
-   virtual bool commitTransaction();
-   virtual bool abortTransaction();
-   virtual bool feedRecord(const DNSResourceRecord &rr, DNSName &ordername);
-
-   virtual bool getDomainInfo(const string &domain, DomainInfo &di);
-   virtual void getUnfreshSlaveInfos(vector<DomainInfo>* domains);
-   virtual void setFresh(uint32_t id);
-*/
 
 bool LUABackend::startTransaction(const DNSName& qname, int id) {
 
index e3075ae8b9234d9079c33521737e8fb2e25f9337..b1f99b03e98afde016bbb17a4ca129d2042eb1ea 100644 (file)
 #include "pdns/logger.hh"
 #include "pdns/arguments.hh"
 
-/*
-  //! determine if ip is a supermaster for a domain
-  virtual bool superMasterBackend(const string &ip, const string &domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **db)
-
-  //! called by PowerDNS to create a slave record for a superMaster
-  virtual bool createSlaveDomain(const string &ip, const string &domain, const string &nameserver, const string &account)
-
-*/
 
 bool LUABackend::superMasterBackend(const string &ip, const DNSName &domain, const vector<DNSResourceRecord>&nsset, string *nameserver, string *account, DNSBackend **db) {