]> source.dussan.org Git - rspamd.git/commitdiff
Race (func MUST be called after all modifications to its argument)
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 23 Mar 2011 16:09:05 +0000 (19:09 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 23 Mar 2011 16:09:05 +0000 (19:09 +0300)
src/dns.c

index 52fe0a9f0f7064d6e1ccfa3e2594f7eb807a526b..6e69b174a498e42c760c5bfe0e7c42788b71b00f 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -1026,9 +1026,11 @@ dns_timer_cb (gint fd, short what, void *arg)
                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);
                dns_check_throttling (req->resolver);
                req->resolver->errors ++;
+
+               req->func (rep, req->arg);
+
                return;
        }
        /* Select other server */
@@ -1092,9 +1094,11 @@ dns_retransmit_handler (gint fd, short what, void *arg)
                        rep->request = req;
                        rep->code = DNS_RC_SERVFAIL;
                        upstream_fail (&rep->request->server->up, rep->request->time);
-                       req->func (rep, req->arg);
                        req->resolver->errors ++;
                        dns_check_throttling (req->resolver);
+
+                       req->func (rep, req->arg);
+
                        return;
                }
                r = send_dns_request (req);