From: Pavel Odintsov Date: Fri, 31 Aug 2018 12:37:09 +0000 (+0100) Subject: Do not reset per query counters when setQueryCount(true) X-Git-Tag: dnsdist-1.3.3~128^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f74fe441f00966436164d4ecd05512cbb89133b8;p=pdns Do not reset per query counters when setQueryCount(true) --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 808f61dc0..755a0f074 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -491,7 +491,7 @@ static void connectionThread(int sock, ComboAddress remote, string password, str } { - WriteLock wl(&g_qcount.queryLock); + ReadLock rl(&g_qcount.queryLock); std::string qname; const string qnamebase = "dnsdist_querycount_queries"; @@ -502,7 +502,6 @@ static void connectionThread(int sock, ComboAddress remote, string password, str const std::string label = "{qname=\"" + qname + "\"}"; output << qnamebase << label << " " << record.second << "\n"; } - g_qcount.records.clear(); } resp.body = output.str();