aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-20 22:57:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-20 22:57:22 +0100
commitb0ecc727aaf37c7fc36dabde7801e3761e3f4b2c (patch)
tree05e0116c82cdfe16200f8b72c48d2b69bc6a1804 /contrib
parente55a24ad1443e02a9b4e909361dd3770b45ec196 (diff)
downloadrspamd-b0ecc727aaf37c7fc36dabde7801e3761e3f4b2c.tar.gz
rspamd-b0ecc727aaf37c7fc36dabde7801e3761e3f4b2c.zip
[Fix] Fix DNS write errors processing
Issue: #971 MFH: true
Diffstat (limited to 'contrib')
-rw-r--r--contrib/librdns/resolver.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/librdns/resolver.c b/contrib/librdns/resolver.c
index 70e226804..5b68b4c1b 100644
--- a/contrib/librdns/resolver.c
+++ b/contrib/librdns/resolver.c
@@ -239,8 +239,10 @@ rdns_parse_reply (uint8_t *in, int r, struct rdns_request *req,
static void
rdns_request_unschedule (struct rdns_request *req)
{
- req->async->del_timer (req->async->data,
- req->async_event);
+ if (req->async_event) {
+ req->async->del_timer (req->async->data,
+ req->async_event);
+ }
/* Remove from id hashes */
HASH_DEL (req->io->requests, req);
}
@@ -382,9 +384,9 @@ rdns_process_timer (void *arg)
UPSTREAM_FAIL (req->io->srv, time (NULL));
}
+ /* We have not scheduled timeout actually due to send error */
rep = rdns_make_reply (req, RDNS_RC_NETERR);
req->state = RDNS_REQUEST_REPLIED;
- rdns_request_unschedule (req);
req->func (rep, req->arg);
REF_RELEASE (req);
}
@@ -525,6 +527,8 @@ rdns_make_request_full (
req->state = RDNS_REQUEST_NEW;
req->packet = NULL;
req->requested_names = calloc (queries, sizeof (struct rdns_request_name));
+ req->async_event = NULL;
+
if (req->requested_names == NULL) {
free (req);
return NULL;