summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-22 15:58:47 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-22 15:58:47 +0400
commit630f3adb8cc4e57f2b2eb1a3d1cac318478ea9de (patch)
tree3f7478449612c5f98d90bed11a48ba9af1b436d2
parenta1e7b9d973818090d02f986b42cbe95fbfb661d5 (diff)
downloadrspamd-0.4.0.tar.gz
rspamd-0.4.0.zip
Fix for libevent.0.4.0
-rw-r--r--src/dns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dns.c b/src/dns.c
index e82b1a9b7..5148e742b 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -539,6 +539,7 @@ send_dns_request (struct rspamd_dns_request *req)
r = send (req->sock, req->packet, req->pos, 0);
if (r == -1) {
if (errno == EAGAIN) {
+ event_del (&req->io_event);
event_set (&req->io_event, req->sock, EV_WRITE, dns_retransmit_handler, req);
event_add (&req->io_event, &req->tv);
register_async_event (req->session, (event_finalizer_t)event_del, &req->io_event, FALSE);
@@ -551,6 +552,7 @@ send_dns_request (struct rspamd_dns_request *req)
}
}
else if (r < req->pos) {
+ event_del (&req->io_event);
event_set (&req->io_event, req->sock, EV_WRITE, dns_retransmit_handler, req);
event_add (&req->io_event, &req->tv);
register_async_event (req->session, (event_finalizer_t)event_del, &req->io_event, FALSE);
@@ -981,6 +983,7 @@ dns_throttling_cb (gint fd, short what, void *arg)
resolver->throttling = FALSE;
resolver->errors = 0;
msg_info ("stop DNS throttling after %d seconds", (int)resolver->throttling_time.tv_sec);
+ event_del (&resolver->throttling_event);
}
static void
@@ -1130,6 +1133,7 @@ dns_retransmit_handler (gint fd, short what, void *arg)
}
else if (r == 1) {
/* Add timer event */
+ event_del (&req->timer_event);
evtimer_set (&req->timer_event, dns_timer_cb, req);
evtimer_add (&req->timer_event, &req->tv);