diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-25 20:04:56 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-25 20:04:56 +0400 |
commit | 71b43d966af50b69605fd91453e90eb3c67a3203 (patch) | |
tree | 19c19a0e2c845cd1e6cc9553bcf84bdc27f03d97 /src | |
parent | 7584957defe9b63084c1fb6b939ae88718752a91 (diff) | |
download | rspamd-71b43d966af50b69605fd91453e90eb3c67a3203.tar.gz rspamd-71b43d966af50b69605fd91453e90eb3c67a3203.zip |
* Add events to lua resolver
* Do not classify non-text messages
Diffstat (limited to 'src')
-rw-r--r-- | src/filter.c | 4 | ||||
-rw-r--r-- | src/lua/lua_task.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c index 96faabd66..e03d169e0 100644 --- a/src/filter.c +++ b/src/filter.c @@ -526,6 +526,10 @@ classifiers_callback (gpointer value, void *arg) } g_hash_table_insert (data->tokens, cl->tokenizer, tokens); } + + if (tokens == NULL) { + return; + } ctx = cl->classifier->init_func (task->task_pool, cl); cl->classifier->classify_func (ctx, task->worker->srv->statfile_pool, tokens, task); diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 082b1690f..594c7ef5c 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -281,6 +281,7 @@ lua_dns_callback (int result, char type, int count, int ttl, void *addresses, vo cd->task->save.saved = 1; process_filters (cd->task); } + remove_forced_event (cd->task->s, (event_finalizer_t)lua_dns_callback); } @@ -302,6 +303,7 @@ lua_task_resolve_dns_a (lua_State *L) } if (evdns_resolve_ipv4 (cd->to_resolve, DNS_QUERY_NO_SEARCH, lua_dns_callback, (void *)cd) == 0) { task->save.saved ++; + register_async_event (task->s, (event_finalizer_t)lua_dns_callback, NULL, TRUE); } } return 0; @@ -327,6 +329,7 @@ lua_task_resolve_dns_ptr (lua_State *L) } if (evdns_resolve_reverse (ina, DNS_QUERY_NO_SEARCH, lua_dns_callback, (void *)cd) == 0) { task->save.saved ++; + register_async_event (task->s, (event_finalizer_t)lua_dns_callback, NULL, TRUE); } } return 0; |