Load a GeoIP database whose modification time is the epoch (#2604)
The newest .mmdb in configs/geoip was picked with mtime > modTime, starting from 0, so a database with an mtime of 0 (as Docker's ADD sets for downloads without Last-Modified) was never loaded and the extension failed with "Could not find GeoIP2 database". Assisted-by: Claude:claude-opus-5-5
This commit is contained in:
@@ -79,7 +79,7 @@ bool GeoIP_Extension::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
{
|
||||
libsys->PathFormat(database, sizeof(database), "%s/%s", m_GeoipDir, name);
|
||||
|
||||
if (libsys->FileTime(database, FileTime_LastChange, &mtime) && mtime > modTime)
|
||||
if (libsys->FileTime(database, FileTime_LastChange, &mtime) && (m_GeoipDb[0] == '\0' || mtime > modTime))
|
||||
{
|
||||
modTime = mtime;
|
||||
ke::SafeStrcpy(m_GeoipDb, sizeof(m_GeoipDb), database);
|
||||
|
||||
Reference in New Issue
Block a user