Module: kamailio
Branch: master
Commit: 51dcab019a42e5b1f3b81247ca71ffcaf46180de
URL:
https://github.com/kamailio/kamailio/commit/51dcab019a42e5b1f3b81247ca71ffc…
Author: Bastian Triller <bastian.triller(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-06-03T11:12:04+02:00
geoip2: Reload database before accessing it
Re-add reloading of database.
GH #3861
Fixes: 293193c55c ("geoip2: clang format module file")
---
Modified: src/modules/geoip2/geoip2_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/51dcab019a42e5b1f3b81247ca71ffc…
Patch:
https://github.com/kamailio/kamailio/commit/51dcab019a42e5b1f3b81247ca71ffc…
---
diff --git a/src/modules/geoip2/geoip2_mod.c b/src/modules/geoip2/geoip2_mod.c
index 7d22b3890d2..cfb40f69860 100644
--- a/src/modules/geoip2/geoip2_mod.c
+++ b/src/modules/geoip2/geoip2_mod.c
@@ -139,6 +139,7 @@ static int geoip2_resid_param(modparam_t type, void *val)
static int ki_geoip2_match(sip_msg_t *msg, str *tomatch, str *pvclass)
{
geoip2_pv_reset(pvclass);
+ geoip2_reload_pv(geoip2_path);
return geoip2_update_pv(tomatch, pvclass);
}
@@ -277,6 +278,8 @@ static int ki_geoip2_distance(
return -1;
}
+ geoip2_reload_pv(geoip2_path);
+
return geoip2_distance(msg, _ipaddr, lat, lon);
}