diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-03-28 21:00:38 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-03-28 21:00:38 +0400 |
commit | 37d6c7f23fd44283d1853141d39ecc3f3a2c54e6 (patch) | |
tree | caa5cbe2aaca2fb09886d43aeb77dbe2c160c553 /src/dns.c | |
parent | 99225e6499d32f2415f64cd9d5d4402d3fb78b30 (diff) | |
download | rspamd-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.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 */ |