mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Makes @geoLookup optional depending on the availability of libGeoIP
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
|
||||
#include "operators/geo_lookup.h"
|
||||
|
||||
#ifdef WITH_GEOIP
|
||||
#include <GeoIPCity.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <functional>
|
||||
@@ -31,10 +33,11 @@ namespace operators {
|
||||
bool GeoLookup::evaluate(Assay *assay, const std::string &exp) {
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
GeoIPRecord *gir;
|
||||
bool ret = true;
|
||||
|
||||
#ifdef WITH_GEOIP
|
||||
GeoIPRecord *gir;
|
||||
|
||||
if (assay) {
|
||||
ret = Utils::GeoLookup::getInstance().lookup(exp, &gir,
|
||||
std::bind(&GeoLookup::debug, this, assay, _1, _2));
|
||||
@@ -85,6 +88,7 @@ bool GeoLookup::evaluate(Assay *assay, const std::string &exp) {
|
||||
|
||||
GeoIPRecord_delete(gir);
|
||||
}
|
||||
#endif // WITH_GEOIP
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user