BUG/MINOR: resolvers: fix sent messages were counted twice

The sent messages counter was increased at both resolver.c and dns.c
layers.

This patch let the dns.c layer count the sent messages since this
layer handle a retry if transport layer is not ready (EAGAIN on udp
or tcp session ring buffer full).

This patch should be backported on all versions using a split of those
layers for resolving (v >=2.4)
This commit is contained in:
Emeric Brun 2021-10-29 16:28:33 +02:00 committed by Willy Tarreau
parent f9d5957cd9
commit c37caab21c

View File

@ -374,9 +374,7 @@ static int resolv_send_query(struct resolv_resolution *resolution)
continue;
}
if (dns_send_nameserver(ns, trash.area, len) < 0)
ns->counters->snd_error++;
else
if (dns_send_nameserver(ns, trash.area, len) >= 0)
resolution->nb_queries++;
}