From c02fc6a9ea847c059de4fb5772106541cebe6845 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 8 Nov 2019 17:46:40 +0000 Subject: [PATCH] [Minor] Except the current upstream when doing final DNS retransmit --- src/libserver/dns.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libserver/dns.c b/src/libserver/dns.c index f5b35eab7..71b8adf9f 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -824,7 +824,13 @@ rspamd_dns_select_upstream_retransmit ( struct upstream_list *ups = ups_data; struct upstream *up; - up = rspamd_upstream_get_forced (ups, RSPAMD_UPSTREAM_RANDOM, name, len); + if (prev_elt) { + up = rspamd_upstream_get_except (ups, (struct upstream *)prev_elt->lib_data, + RSPAMD_UPSTREAM_MASTER_SLAVE, name, len); + } + else { + up = rspamd_upstream_get_forced (ups, RSPAMD_UPSTREAM_RANDOM, name, len); + } if (up) { msg_debug ("select forced %s", rspamd_upstream_name (up)); -- 2.39.5