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();
file_map_t map;
const char *p, *end;
char line[BUFSIZ];
+ uint32_t count = 0;
if (!file_map_open(&map, file, false)) {
return NULL;
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;
}
trie_delete(&domains);
*pdomains = NULL;
}
+ info("rhbl %s loaded, %u hosts, %u domains", file, host_count, domain_count);
return hosts != NULL || domains != NULL;
}