]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
geoipbackend: Switch to new filename syntax
authorAki Tuomi <cmouse@cmouse.fi>
Sat, 30 Dec 2017 15:25:18 +0000 (17:25 +0200)
committerAki Tuomi <cmouse@cmouse.fi>
Wed, 14 Feb 2018 07:15:53 +0000 (09:15 +0200)
Requires new filename syntax, which is
[driver:]filename[;opt=value]

Currently only dat driver with mode=standard,cache,index,mmap is supported.

modules/geoipbackend/geoipbackend.cc

index 9f536666fa0f9107057415aef5e6166c4dcea08e..7e3aa2470e9a35469a53edc28055b3136878f682 100644 (file)
@@ -88,15 +88,13 @@ void GeoIPBackend::initialize() {
   YAML::Node config;
   vector<GeoIPDomain> tmp_domains;
 
-  string modeStr = getArg("database-cache");
   s_geoip_files.clear(); // reset pointers
 
   if (getArg("database-files").empty() == false) {
     vector<string> files;
     stringtok(files, getArg("database-files"), " ,\t\r\n");
     for(auto const& file: files) {
-      const string& fileStr = string("dat:") + file + string(";mode=") + modeStr;
-      s_geoip_files.push_back(GeoIPInterface::makeInterface(fileStr));
+      s_geoip_files.push_back(GeoIPInterface::makeInterface(file));
     }
   }
 
@@ -776,8 +774,7 @@ public:
 
   void declareArguments(const string &suffix = "") {
     declare(suffix, "zones-file", "YAML file to load zone(s) configuration", "");
-    declare(suffix, "database-files", "File(s) to load geoip data from", "");
-    declare(suffix, "database-cache", "Cache mode (standard, memory, index, mmap)", "standard");
+    declare(suffix, "database-files", "File(s) to load geoip data from ([driver:]path[;opt=value]", "");
     declare(suffix, "dnssec-keydir", "Directory to hold dnssec keys (also turns DNSSEC on)", "");
   }