diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-11 16:44:06 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-11 16:44:06 +0000 |
commit | fa687ca63177a2531078d0efa158ccafe5599573 (patch) | |
tree | 02160714722131d57b248d62d85296e308a661e8 /src/libserver/dns.c | |
parent | 471512852c655f9ecd23a69b3b2c47319dc9f437 (diff) | |
download | rspamd-fa687ca63177a2531078d0efa158ccafe5599573.tar.gz rspamd-fa687ca63177a2531078d0efa158ccafe5599573.zip |
[Feature] Override DNS requests limits for SPF and DKIM
Diffstat (limited to 'src/libserver/dns.c')
-rw-r--r-- | src/libserver/dns.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/libserver/dns.c b/src/libserver/dns.c index 937b1c030..3c67411a0 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -114,15 +114,17 @@ make_dns_request (struct rspamd_dns_resolver *resolver, return TRUE; } -gboolean make_dns_request_task (struct rspamd_task *task, +static gboolean +make_dns_request_task_common (struct rspamd_task *task, dns_callback_type cb, gpointer ud, enum rdns_request_type type, - const char *name) + const char *name, + gboolean forced) { gboolean ret; - if (task->dns_requests >= task->cfg->dns_max_requests) { + if (!forced && task->dns_requests >= task->cfg->dns_max_requests) { return FALSE; } @@ -132,7 +134,7 @@ gboolean make_dns_request_task (struct rspamd_task *task, if (ret) { task->dns_requests ++; - if (task->dns_requests >= task->cfg->dns_max_requests) { + if (!forced && task->dns_requests >= task->cfg->dns_max_requests) { msg_info_task ("<%s> stop resolving on reaching %ud requests", task->message_id, task->dns_requests); } @@ -141,6 +143,26 @@ gboolean make_dns_request_task (struct rspamd_task *task, return ret; } +gboolean +make_dns_request_task (struct rspamd_task *task, + dns_callback_type cb, + gpointer ud, + enum rdns_request_type type, + const char *name) +{ + return make_dns_request_task_common (task, cb, ud, type, name, FALSE); +} + +gboolean +make_dns_request_task_forced (struct rspamd_task *task, + dns_callback_type cb, + gpointer ud, + enum rdns_request_type type, + const char *name) +{ + return make_dns_request_task_common (task, cb, ud, type, name, TRUE); +} + static void rspamd_rnds_log_bridge ( void *log_data, enum rdns_log_level level, |