]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Except the current upstream when doing final DNS retransmit
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2019 17:46:40 +0000 (17:46 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2019 17:46:40 +0000 (17:46 +0000)
src/libserver/dns.c

index f5b35eab7b78caa4207df52f61903a442d72efec..71b8adf9f96779a438aba7aef2e50de18926f1bd 100644 (file)
@@ -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));