diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-08 21:21:53 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-08 21:21:53 +0400 |
commit | 8e399cdba1bba1da8c1de2b8a22efe719aa30cde (patch) | |
tree | 579eca49aa1fd0b01d4b9739418f8ed592225ef4 /src/client | |
parent | a1e2b2d84b185b5430252d7ead5806944be433af (diff) | |
download | rspamd-8e399cdba1bba1da8c1de2b8a22efe719aa30cde.tar.gz rspamd-8e399cdba1bba1da8c1de2b8a22efe719aa30cde.zip |
* Use murmur hash for all hashes as it is more efficient and provides more uniform distribution as glib's default one.
* Fix probability renormalization while using advanced classification.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/rspamc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index aae8345d5..74423bbf3 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -352,7 +352,7 @@ scan_rspamd_stdin (void) GHashTable *opts; /* Init options hash */ - opts = g_hash_table_new (g_str_hash, g_str_equal); + opts = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); add_options (opts); /* Add server */ add_rspamd_server (FALSE); @@ -390,7 +390,7 @@ scan_rspamd_file (const gchar *file) /* Add server */ add_rspamd_server (FALSE); /* Init options hash */ - opts = g_hash_table_new (g_str_hash, g_str_equal); + opts = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); add_options (opts); res = rspamd_scan_file (client, file, opts, &err); g_hash_table_destroy (opts); @@ -435,7 +435,7 @@ learn_rspamd_stdin (gboolean is_spam) } } - params = g_hash_table_new (g_str_hash, g_str_equal); + params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); g_hash_table_insert (params, "Classifier", classifier); results = rspamd_controller_command_memory (client, is_spam ? "learn_spam" : "learn_ham", password, params, in_buf, r, &err); @@ -482,7 +482,7 @@ learn_rspamd_file (gboolean is_spam, const gchar *file) /* Add server */ add_rspamd_server (TRUE); - params = g_hash_table_new (g_str_hash, g_str_equal); + params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); g_hash_table_insert (params, "Classifier", classifier); results = rspamd_controller_command_file (client, is_spam ? "learn_spam" : "learn_ham", password, params, file, &err); @@ -525,7 +525,7 @@ fuzzy_rspamd_stdin (gboolean delete) gchar valuebuf[sizeof("65535")], flagbuf[sizeof("65535")]; struct rspamd_controller_result *res; - params = g_hash_table_new (g_str_hash, g_str_equal); + params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); rspamd_snprintf (valuebuf, sizeof (valuebuf), "%d", weight); rspamd_snprintf (flagbuf, sizeof (flagbuf), "%d", flag); g_hash_table_insert (params, "Value", valuebuf); @@ -588,7 +588,7 @@ fuzzy_rspamd_file (const gchar *file, gboolean delete) /* Add server */ add_rspamd_server (TRUE); - params = g_hash_table_new (g_str_hash, g_str_equal); + params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); rspamd_snprintf (valuebuf, sizeof (valuebuf), "%d", weight); rspamd_snprintf (flagbuf, sizeof (flagbuf), "%d", flag); g_hash_table_insert (params, "Value", valuebuf); @@ -671,7 +671,7 @@ main (gint argc, gchar **argv, gchar **env) GHashTable *kwattrs; - kwattrs = g_hash_table_new (g_str_hash, g_str_equal); + kwattrs = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); read_cmd_line (&argc, &argv); |