diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-23 16:07:53 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-23 16:33:06 +0100 |
commit | 6f84b92277c754dabd00a14deb785d11cbeb5e1c (patch) | |
tree | d9206c5aae0772b04811ee5f1c1a97594d6ba415 /src | |
parent | fc6d858a36a19208428ce65ebcb711a480f143f5 (diff) | |
download | rspamd-6f84b92277c754dabd00a14deb785d11cbeb5e1c.tar.gz rspamd-6f84b92277c754dabd00a14deb785d11cbeb5e1c.zip |
[Minor] Allow to create upstreams without a context
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/upstream.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 9a752c79d..4ed657da4 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -537,7 +537,18 @@ rspamd_upstreams_create (struct upstream_ctx *ctx) ls->cur_elt = 0; ls->ctx = ctx; ls->rot_alg = RSPAMD_UPSTREAM_UNDEF; - ls->limits = ctx->limits; + + if (ctx) { + ls->limits = ctx->limits; + } + else { + ls->limits.error_time = default_error_time; + ls->limits.max_errors = default_max_errors; + ls->limits.dns_retransmits = default_dns_retransmits; + ls->limits.dns_timeout = default_dns_timeout; + ls->limits.revive_jitter = default_revive_jitter; + ls->limits.revive_time = default_revive_time; + } return ls; } |