From: Florent Bruneau Date: Fri, 17 Oct 2008 20:50:23 +0000 (+0200) Subject: Cleanup logging, add stats for strlists. X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=commitdiff_plain;h=8cecbefa8f63c37cf7a8e9932eea137edcdd5773 Cleanup logging, add stats for strlists. Signed-off-by: Florent Bruneau --- diff --git a/postlicyd/greylist.c b/postlicyd/greylist.c index 936f0e2..b2ea86c 100644 --- a/postlicyd/greylist.c +++ b/postlicyd/greylist.c @@ -105,7 +105,6 @@ static TCBDB *greylist_db_get(const greylist_config_t *config, char tmppath[PATH_MAX]; snprintf(tmppath, PATH_MAX, "%s.tmp", path); - info("database cleanup started"); awl_db = tcbdbnew(); if (tcbdbopen(awl_db, path, BDBOREADER)) { tmp_db = tcbdbnew(); diff --git a/postlicyd/strlist.c b/postlicyd/strlist.c index b66c33a..07b358e 100644 --- a/postlicyd/strlist.c +++ b/postlicyd/strlist.c @@ -119,6 +119,7 @@ static trie_t *strlist_create(const char *file, bool reverse, bool lock) file_map_t map; const char *p, *end; char line[BUFSIZ]; + uint32_t count = 0; if (!file_map_open(&map, file, false)) { return NULL; @@ -156,12 +157,14 @@ static trie_t *strlist_create(const char *file, bool reverse, bool lock) if (p < eos) { strlist_copy(line, p, eos - p, reverse); trie_insert(db, line); + ++count; } } p = eol + 1; } file_map_close(&map); trie_compile(db, lock); + info("%s loaded, %u entries", file, count); return db; } @@ -241,6 +244,7 @@ static bool strlist_create_from_rhbl(const char *file, bool lock, trie_delete(&domains); *pdomains = NULL; } + info("rhbl %s loaded, %u hosts, %u domains", file, host_count, domain_count); return hosts != NULL || domains != NULL; }