]> source.dussan.org Git - rspamd.git/commitdiff
* Add events to lua resolver
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 25 Sep 2009 16:04:56 +0000 (20:04 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 25 Sep 2009 16:04:56 +0000 (20:04 +0400)
* Do not classify non-text messages

src/filter.c
src/lua/lua_task.c

index 96faabd66819fdf1cdffab1bcb9f8d31c092d61b..e03d169e0b7507a785c0c3daedcf4f1d7c1446eb 100644 (file)
@@ -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);
index 082b1690f274ea83bf4a99c8fc506253dc389d06..594c7ef5c3c31ceb5889d0fa182662c06ccef751 100644 (file)
@@ -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;