diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-09-16 19:18:23 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-09-16 19:18:23 +0400 |
commit | 18e0c770b951c5d8a1269b3829b73a416fc261fe (patch) | |
tree | 31ab1e9eee734251a883b0e9409f7983fedd940d /src/tokenizers/tokenizers.c | |
parent | e2d78f30503d3f02eec9925f2e222b7b1493f1ad (diff) | |
download | rspamd-18e0c770b951c5d8a1269b3829b73a416fc261fe.tar.gz rspamd-18e0c770b951c5d8a1269b3829b73a416fc261fe.zip |
* Fix shared usage of statfiles
* Add invalidation of statfiles in case of learning, so now statfiles
are invalidated in about a minute after learning
* This should fix shared usage of statfile pool by several processes
Diffstat (limited to 'src/tokenizers/tokenizers.c')
-rw-r--r-- | src/tokenizers/tokenizers.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tokenizers/tokenizers.c b/src/tokenizers/tokenizers.c index 2bb478aaa..9ca690e47 100644 --- a/src/tokenizers/tokenizers.c +++ b/src/tokenizers/tokenizers.c @@ -196,15 +196,16 @@ tokenize_headers (memory_pool_t * pool, struct worker_task *task, GTree ** tree) const char *value; ls = GMIME_OBJECT (task->message)->headers; + iter = g_mime_header_iter_new (); if (g_mime_header_list_get_iter (ls, iter)) { while (g_mime_header_iter_is_valid (iter)) { new = memory_pool_alloc (pool, sizeof (token_node_t)); name = g_mime_header_iter_get_name (iter); value = g_mime_header_iter_get_value (iter); - headername.begin = name; + headername.begin = (u_char *)name; headername.len = strlen (name); - headervalue.begin = value; + headervalue.begin = (u_char *)value; headervalue.len = strlen (value); new->h1 = fstrhash (&headername) * primes[0]; new->h2 = fstrhash (&headervalue) * primes[1]; @@ -216,6 +217,7 @@ tokenize_headers (memory_pool_t * pool, struct worker_task *task, GTree ** tree) } } } + g_mime_header_iter_free (iter); #endif return TRUE; } |