From 76025fec825af54e79b4253d3c814464e8a62263 Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Fri, 31 Aug 2018 16:25:13 +0100 Subject: [PATCH] Added address label and switched code to boost::format --- pdns/dnsdist-web.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"; -- 2.47.2