Read fuzzy hash databases on init

Instead of reading the fuzzy db on every invocation, read and store
the db contents during initialization and store the contents in memory.
The only significant behavior change here is that a change in db contents
now (obviously) requires a daemon restart, as no API is provided to
flush the list of ssdeep chunks.
This commit is contained in:
Robert Paprocki
2017-03-02 13:52:45 -08:00
committed by Felipe Zimmerle
parent fd49ca7138
commit 96a1f55e16
2 changed files with 40 additions and 19 deletions

View File

@@ -409,8 +409,14 @@ struct msre_cache_rec {
apr_size_t val_len;
};
struct fuzzy_hash_chunk {
const char *data;
struct fuzzy_hash_chunk *next;
};
struct fuzzy_hash_param_data {
const char *file;
struct fuzzy_hash_chunk *head;
int threshold;
};