]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: resolvers: fix sent messages were counted twice
authorEmeric Brun <ebrun@haproxy.com>
Fri, 29 Oct 2021 14:28:33 +0000 (16:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Nov 2021 16:16:46 +0000 (17:16 +0100)
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)

src/resolvers.c

index 003ce62d1acef6be8a7fd96ed56fae47915d62e9..e0a5b00715c49169229b8fc855e33ff7ed9f9f70 100644 (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++;
        }