extern sig_atomic_t wanna_die;
+
static gint
compare_nodes (gconstpointer a, gconstpointer b, gpointer unused)
{
}
server_stat->fuzzy_hashes--;
rspamd_bloom_del (bf, node->h.hash_pipe);
- g_hash_table_remove (static_hash, node->h.hash_pipe);
+ g_hash_table_remove (static_hash, &node->h);
}
else {
cur = (GList *)to_expire[i];
}
}
if (ctx->strict_hash) {
- g_hash_table_insert (static_hash, node->h.hash_pipe, node);
+ g_hash_table_insert (static_hash, &node->h, node);
}
else {
if (node->value > (gint)ctx->frequent_score) {
gint prob = 0;
if (ctx->strict_hash) {
- h = g_hash_table_lookup (static_hash, s->hash_pipe);
+ h = g_hash_table_lookup (static_hash, s);
if (h != NULL) {
if (h->time == INVALID_NODE_TIME) {
/* Node is expired */
h->value = cmd->value;
h->flag = cmd->flag;
if (ctx->strict_hash) {
- g_hash_table_insert (static_hash, h->h.hash_pipe, h);
+ g_hash_table_insert (static_hash, &h->h, h);
}
else {
g_queue_push_head (hashes[cmd->blocksize % BUCKETS], h);
if (ctx->strict_hash) {
rspamd_rwlock_writer_lock (ctx->tree_lock);
- if (g_hash_table_remove (static_hash, s->hash_pipe)) {
+ if (g_hash_table_remove (static_hash, s)) {
rspamd_bloom_del (bf, s->hash_pipe);
msg_info ("fuzzy hash was successfully deleted");
server_stat->fuzzy_hashes--;
sigh->handler_data = worker;
if (ctx->strict_hash) {
- static_hash = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal,
+ static_hash = g_hash_table_new_full (rspamd_fuzzy_hash, rspamd_fuzzy_equal,
NULL, rspamd_fuzzy_free_node);
}
else {