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/dns.c | |
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/dns.c')
-rw-r--r-- | src/dns.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1220,6 +1220,7 @@ dns_read_cb (gint fd, short what, void *arg) } upstream_ok (&rep->request->server->up, rep->request->time); rep->request->func (rep, rep->request->arg); + remove_normal_event (req->session, dns_fin_cb, req); } } } @@ -1239,11 +1240,11 @@ dns_timer_cb (gint fd, short what, void *arg) rep->request = req; rep->code = DNS_RC_SERVFAIL; upstream_fail (&rep->request->server->up, rep->request->time); - remove_normal_event (req->session, dns_fin_cb, req); dns_check_throttling (req->resolver); req->resolver->errors ++; req->func (rep, req->arg); + remove_normal_event (req->session, dns_fin_cb, req); return; } @@ -1262,8 +1263,9 @@ dns_timer_cb (gint fd, short what, void *arg) rep = memory_pool_alloc0 (req->pool, sizeof (struct rspamd_dns_reply)); rep->request = req; rep->code = DNS_RC_SERVFAIL; - remove_normal_event (req->session, dns_fin_cb, req); + req->func (rep, req->arg); + remove_normal_event (req->session, dns_fin_cb, req); return; } @@ -1277,8 +1279,9 @@ dns_timer_cb (gint fd, short what, void *arg) rep->request = req; rep->code = DNS_RC_SERVFAIL; upstream_fail (&rep->request->server->up, rep->request->time); - remove_normal_event (req->session, dns_fin_cb, req); + req->func (rep, req->arg); + remove_normal_event (req->session, dns_fin_cb, req); return; } @@ -1288,9 +1291,9 @@ dns_timer_cb (gint fd, short what, void *arg) rep = memory_pool_alloc0 (req->pool, sizeof (struct rspamd_dns_reply)); rep->request = req; rep->code = DNS_RC_SERVFAIL; - remove_normal_event (req->session, dns_fin_cb, req); upstream_fail (&rep->request->server->up, rep->request->time); req->func (rep, req->arg); + remove_normal_event (req->session, dns_fin_cb, req); return; } evtimer_add (&req->timer_event, &req->tv); @@ -1303,6 +1306,8 @@ dns_retransmit_handler (gint fd, short what, void *arg) struct rspamd_dns_reply *rep; gint r; + remove_normal_event (req->session, (event_finalizer_t)event_del, &req->io_event); + if (what == EV_WRITE) { /* Retransmit dns request */ req->retransmits ++; |