X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Fstrlist.c;h=07b358ef76f223807a54885fa610c2211905ef13;hb=8cecbefa8f63c37cf7a8e9932eea137edcdd5773;hp=9469ad07fdfe539be9660980a8b271466a6bb165;hpb=6119309deb6946c7d19e29c883008aa88c410e66;p=apps%2Fpfixtools.git diff --git a/postlicyd/strlist.c b/postlicyd/strlist.c index 9469ad0..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; } @@ -522,7 +526,7 @@ static void strlist_filter_async(rbl_result_t *result, void *arg) --async->awaited; debug("got asynchronous request result for filter %s, rbl %d, still awaiting %d answers", - filter->name, result - array_ptr(async->results, 0), async->awaited); + filter->name, (int)(result - array_ptr(async->results, 0)), async->awaited); if (async->awaited == 0) { filter_result_t res = HTK_FAIL;