diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:05:56 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:05:56 +0300 |
commit | 4499fc92189905fde71139822d784ab7819b181c (patch) | |
tree | 4057f60b1af82b52649d05f79a804543c57ae6f4 /src/plugins | |
parent | 7072f8548414cf0e88babd7556f1f893c93ba3dc (diff) | |
download | rspamd-4499fc92189905fde71139822d784ab7819b181c.tar.gz rspamd-4499fc92189905fde71139822d784ab7819b181c.zip |
* Finally get rid of stupid savepoints system and migrate to async events logic completely
Fix lua redis library.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/fuzzy_check.c | 14 | ||||
-rw-r--r-- | src/plugins/spf.c | 7 | ||||
-rw-r--r-- | src/plugins/surbl.c | 69 |
3 files changed, 1 insertions, 89 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index f330e7ecd..f7191117b 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -522,13 +522,6 @@ fuzzy_io_callback (gint fd, short what, void *arg) msg_err ("got error on IO with server %s:%d, %d, %s", session->server->name, session->server->port, errno, strerror (errno)); ok: remove_normal_event (session->task->s, fuzzy_io_fin, session); - - session->task->save.saved--; - if (session->task->save.saved == 0) { - /* Call other filters */ - session->task->save.saved = 1; - process_filters (session->task); - } } static void @@ -601,12 +594,6 @@ fuzzy_learn_callback (gint fd, short what, void *arg) } ok: remove_normal_event (session->session->s, fuzzy_learn_fin, session); - - (*session->saved)--; - if (*session->saved == 0) { - session->session->state = STATE_REPLY; - session->session->dispatcher->write_callback (session->session); - } } static inline void @@ -642,7 +629,6 @@ register_fuzzy_call (struct worker_task *task, fuzzy_hash_t *h) session->server = selected; event_add (&session->ev, &session->tv); register_async_event (task->s, fuzzy_io_fin, session, FALSE); - task->save.saved++; } } } diff --git a/src/plugins/spf.c b/src/plugins/spf.c index e9b1531ac..12ec80e67 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -227,13 +227,6 @@ spf_plugin_callback (struct spf_record *record, struct worker_task *task) } spf_check_list (l, task); } - - if (task->save.saved == 0) { - /* Call other filters */ - task->save.saved = 1; - /* Note that here task MAY be destroyed */ - process_filters (task); - } } diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index b848d2a30..b1f51b7fc 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -634,7 +634,6 @@ make_surbl_requests (struct uri *url, struct worker_task *task, debug_task ("send surbl dns request %s", surbl_req); if (make_dns_request (task->resolver, task->s, task->task_pool, dns_callback, (void *)param, DNS_REQUEST_A, surbl_req)) { task->dns_requests ++; - param->task->save.saved++; } } else if (err != NULL && err->code != WHITELIST_ERROR) { @@ -703,13 +702,6 @@ dns_callback (struct rspamd_dns_reply *reply, gpointer arg) else { debug_task ("<%s> domain [%s] is not in surbl %s", param->task->message_id, param->host_resolve, param->suffix->suffix); } - - param->task->save.saved--; - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } } static void @@ -723,12 +715,6 @@ memcached_callback (memcached_ctx_t * ctx, memc_error_t error, void *data) if (error != OK) { msg_info ("memcached returned error %s on CONNECT stage", memc_strerror (error)); memc_close_ctx (param->ctx); - param->task->save.saved--; - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } } else { memc_get (param->ctx, param->ctx->param); @@ -738,12 +724,6 @@ memcached_callback (memcached_ctx_t * ctx, memc_error_t error, void *data) if (error != OK) { msg_info ("memcached returned error %s on READ stage", memc_strerror (error)); memc_close_ctx (param->ctx); - param->task->save.saved--; - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } } else { url_count = (gint *)param->ctx->param->buf; @@ -764,12 +744,6 @@ memcached_callback (memcached_ctx_t * ctx, memc_error_t error, void *data) msg_info ("memcached returned error %s on WRITE stage", memc_strerror (error)); } memc_close_ctx (param->ctx); - param->task->save.saved--; - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } make_surbl_requests (param->url, param->task, param->suffix, FALSE); break; default: @@ -862,14 +836,6 @@ redirector_callback (gint fd, short what, void *arg) msg_err ("write failed %s to %s", strerror (errno), param->redirector->name); upstream_fail (¶m->redirector->up, param->task->tv.tv_sec); remove_normal_event (param->task->s, free_redirector_session, param); - - param->task->save.saved--; - make_surbl_requests (param->url, param->task, param->suffix, FALSE); - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } return; } param->state = STATE_READ; @@ -880,13 +846,6 @@ redirector_callback (gint fd, short what, void *arg) upstream_fail (¶m->redirector->up, param->task->tv.tv_sec); remove_normal_event (param->task->s, free_redirector_session, param); - param->task->save.saved--; - make_surbl_requests (param->url, param->task, param->suffix, FALSE); - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } return; } break; @@ -896,14 +855,8 @@ redirector_callback (gint fd, short what, void *arg) if (r <= 0) { msg_err ("read failed: %s from %s", strerror (errno), param->redirector->name); upstream_fail (¶m->redirector->up, param->task->tv.tv_sec); - remove_normal_event (param->task->s, free_redirector_session, param); - param->task->save.saved--; make_surbl_requests (param->url, param->task, param->suffix, FALSE); - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } + remove_normal_event (param->task->s, free_redirector_session, param); return; } @@ -925,29 +878,12 @@ redirector_callback (gint fd, short what, void *arg) } upstream_ok (¶m->redirector->up, param->task->tv.tv_sec); remove_normal_event (param->task->s, free_redirector_session, param); - - param->task->save.saved--; - make_surbl_requests (param->url, param->task, param->suffix, FALSE); - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } - } else { msg_info ("<%s> reading redirector %s timed out, while waiting for read", param->redirector->name, param->task->message_id); upstream_fail (¶m->redirector->up, param->task->tv.tv_sec); remove_normal_event (param->task->s, free_redirector_session, param); - - param->task->save.saved--; - make_surbl_requests (param->url, param->task, param->suffix, FALSE); - if (param->task->save.saved == 0) { - /* Call other filters */ - param->task->save.saved = 1; - process_filters (param->task); - } } break; } @@ -975,7 +911,6 @@ register_redirector_call (struct uri *url, struct worker_task *task, if (s == -1) { msg_info ("<%s> cannot create tcp socket failed: %s", task->message_id, strerror (errno)); - task->save.saved--; make_surbl_requests (url, task, suffix, FALSE); return; } @@ -1036,7 +971,6 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) insert_result (param->task, surbl_module_ctx->redirector_symbol, 1, g_list_prepend (NULL, red_domain)); } register_redirector_call (url, param->task, param->suffix, red_domain); - param->task->save.saved++; return FALSE; } } @@ -1047,7 +981,6 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) else { if (param->task->worker->srv->cfg->memcached_servers_num > 0) { register_memcached_call (url, param->task, param->suffix); - param->task->save.saved++; } else { make_surbl_requests (url, param->task, param->suffix, FALSE); |