aboutsummaryrefslogtreecommitdiffstats
path: root/src/dns.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-28 21:00:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-28 21:00:38 +0400
commit37d6c7f23fd44283d1853141d39ecc3f3a2c54e6 (patch)
treecaa5cbe2aaca2fb09886d43aeb77dbe2c160c553 /src/dns.c
parent99225e6499d32f2415f64cd9d5d4402d3fb78b30 (diff)
downloadrspamd-37d6c7f23fd44283d1853141d39ecc3f3a2c54e6.tar.gz
rspamd-37d6c7f23fd44283d1853141d39ecc3f3a2c54e6.zip
* Add more timeouts: for fuzzy operations, for worker task operations
Handle miliseconds using a common macro.
Diffstat (limited to 'src/dns.c')
-rw-r--r--src/dns.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/dns.c b/src/dns.c
index 6e69b174a..07ad97ce8 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -1198,10 +1198,8 @@ make_dns_request (struct rspamd_dns_resolver *resolver,
}
/* Fill timeout */
- req->tv.tv_sec = resolver->request_timeout / 1000;
- req->tv.tv_usec = (resolver->request_timeout - req->tv.tv_sec * 1000) * 1000;
+ msec_to_tv (resolver->request_timeout, &req->tv);
-
/* Now send request to server */
r = send_dns_request (req);
@@ -1287,8 +1285,7 @@ dns_resolver_init (struct config_file *cfg)
new->request_timeout = cfg->dns_timeout;
new->max_retransmits = cfg->dns_retransmits;
new->max_errors = cfg->dns_throttling_errors;
- new->throttling_time.tv_sec = cfg->dns_throttling_time / 1000;
- new->throttling_time.tv_usec = (cfg->dns_throttling_time - new->throttling_time.tv_sec * 1000) * 1000;
+ msec_to_tv (cfg->dns_throttling_time, &new->throttling_time);
if (cfg->nameservers == NULL) {
/* Parse resolv.conf */