From: Robin Geuze Date: Mon, 6 Mar 2017 14:36:38 +0000 (+0100) Subject: Also update showPools to display the used server selection policy X-Git-Tag: rec-4.1.0-alpha1~228^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=938184df3adf1d0fa5e83d97286774565000c0d2;p=thirdparty%2Fpdns.git Also update showPools to display the used server selection policy --- diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index e749325973..e582f53714 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -643,15 +643,19 @@ void moreLua(bool client) setLuaNoSideEffect(); try { ostringstream ret; - boost::format fmt("%1$-20.20s %|25t|%2$20s %|50t|%3%" ); - // 1 3 4 - ret << (fmt % "Name" % "Cache" % "Servers" ) << endl; + boost::format fmt("%1$-20.20s %|25t|%2$20s %|25t|%3$20s %|50t|%4%" ); + // 1 2 3 4 + ret << (fmt % "Name" % "Cache" % "ServerPolicy" % "Servers" ) << endl; const auto localPools = g_pools.getCopy(); for (const auto& entry : localPools) { const string& name = entry.first; const std::shared_ptr pool = entry.second; string cache = pool->packetCache != nullptr ? pool->packetCache->toString() : ""; + string policy = g_policy.getLocal()->name; + if (pool->policy != NULL) { + policy = pool->policy->name; + } string servers; for (const auto& server: pool->servers) { @@ -665,7 +669,7 @@ void moreLua(bool client) servers += server.second->remote.toStringWithPort(); } - ret << (fmt % name % cache % servers) << endl; + ret << (fmt % name % cache % policy % servers) << endl; } g_outputBuffer=ret.str(); }catch(std::exception& e) { g_outputBuffer=e.what(); throw; }