}
}
if (!greylist_db_need_cleanup(config, awl_db) || config->max_age <= 0) {
- info("no cleanup needed");
+ info("%s loaded: no cleanup needed", path);
res->db = awl_db;
return &res->db;
} else {
}
++old_count;
} while (tcbdbcurnext(cur));
- now = time(0);
tcbdbput(tmp_db, "@@cleanup@@", strlen("@@cleanup@@"), &now, sizeof(now));
}
tcxstrdel(key);
/** Cleanup successful, replace the old database with the new one.
*/
if (trashable) {
- info("database cleanup finished: database was corrupted, create a new one");
+ info("%s cleanup: database was corrupted, create a new one", path);
unlink(path);
} else if (replace) {
- info("database cleanup finished: before %u entries, after %d entries",
- old_count, new_count);
+ info("%s cleanup: done in %us, before %u, after %u entries",
+ path, (uint32_t)(time(0) - now), old_count, new_count);
unlink(path);
if (rename(tmppath, path) != 0) {
UNIXERR("rename");
}
} else {
unlink(tmppath);
- info("database cleanup finished: nothing to do, %u entries", new_count);
+ info("%s cleanup: done in %us, nothing to do, %u entries",
+ path, (uint32_t)(time(0) - now), old_count);
}
}
return NULL;
}
+ info("%s loaded", path);
res->db = awl_db;
return &res->db;
}
if (config->client_awl) {
snprintf(path, sizeof(path), "%s/%swhitelist.db", directory, prefix);
- info("loading auto-whitelist database");
config->awl_db = greylist_db_get(config, path,
sizeof(struct awl_entry),
(db_entry_checker_t)(greylist_check_awlentry));
}
snprintf(path, sizeof(path), "%s/%sgreylist.db", directory, prefix);
- info("loading greylist database");
config->obj_db = greylist_db_get(config, path,
sizeof(struct obj_entry),
(db_entry_checker_t)(greylist_check_object));