Adds support for libMaxMind

This commit is contained in:
Felipe Zimmerle
2018-03-21 19:48:52 -03:00
parent 7bff76d794
commit df169ea108
20 changed files with 845 additions and 115 deletions

View File

@@ -2438,10 +2438,10 @@ namespace yy {
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
if (GeoLookup::getInstance().setDataBase(file) == false) {
if (GeoLookup::getInstance().setDataBase(file, &err) == false) {
std::stringstream ss;
ss << "Failed to load the GeoDB from: ";
ss << file;
ss << file << ". " << err;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}

View File

@@ -1557,10 +1557,10 @@ expression:
driver.error(@0, ss.str());
YYERROR;
}
if (GeoLookup::getInstance().setDataBase(file) == false) {
if (GeoLookup::getInstance().setDataBase(file, &err) == false) {
std::stringstream ss;
ss << "Failed to load the GeoDB from: ";
ss << file;
ss << file << ". " << err;
driver.error(@0, ss.str());
YYERROR;
}