From: Pavel Odintsov Date: Fri, 31 Aug 2018 15:25:13 +0000 (+0100) Subject: Added address label and switched code to boost::format X-Git-Tag: dnsdist-1.3.3~128^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76025fec825af54e79b4253d3c814464e8a62263;p=thirdparty%2Fpdns.git Added address label and switched code to boost::format --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 324479fc62..e2e756c8ea 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -34,6 +34,7 @@ #include "htmlfiles.h" #include "base64.hh" #include "gettime.hh" +#include bool g_apiReadWrite{false}; std::string g_apiConfigDirectory; @@ -439,7 +440,9 @@ static void connectionThread(int sock, ComboAddress remote, string password, str boost::replace_all(serverName, ".", "_"); - const string label = "{server=\"" + serverName + "\"}"; + const std::string label = boost::str(boost::format("{server=\"%1%\",address=\"%2%\"}") + % serverName % state->remote.toStringWithPort()); + output << statesbase << "queries" << label << " " << state->queries.load() << "\n"; output << statesbase << "drops" << label << " " << state->reuseds.load() << "\n"; output << statesbase << "latency" << label << " " << state->latencyUsec/1000.0 << "\n";