]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix the formatting of 'showServers' 12535/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 10 Feb 2023 15:01:58 +0000 (16:01 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 10 Feb 2023 15:01:58 +0000 (16:01 +0100)
Long IPv6 addresses and huge weight and order values were not properly
handled.

pdns/dnsdist-lua.cc

index 0047d44e7bb8b9aeb018a8aca93227f1e962f218..e77170d94fe514ea973d44e105123127396bd2c8 100644 (file)
@@ -878,13 +878,14 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     try {
       ostringstream ret;
       boost::format fmt;
+
       if (showUUIDs) {
-        fmt = boost::format("%1$-3d %15$-36s %2$-20.20s %|62t|%3% %|92t|%4$5s %|88t|%5$7.1f %|103t|%6$7d %|106t|%7$3d %|115t|%8$2d %|117t|%9$10d %|123t|%10$7d %|128t|%11$5.1f %|146t|%12$5.1f %|152t|%13$11d %14%");
+        fmt = boost::format("%1$-3d %15$-36s %2$-20.20s %|62t|%3% %|107t|%4$5s %|88t|%5$7.1f %|103t|%6$7d %|106t|%7$10d %|115t|%8$10d %|117t|%9$10d %|123t|%10$7d %|128t|%11$5.1f %|146t|%12$5.1f %|152t|%13$11d %14%");
         //             1        2          3       4        5       6       7       8           9        10        11       12     13              14        15
         ret << (fmt % "#" % "Name" % "Address" % "State" % "Qps" % "Qlim" % "Ord" % "Wt" % "Queries" % "Drops" % "Drate" % "Lat" % "Outstanding" % "Pools" % "UUID") << endl;
       }
       else {
-        fmt = boost::format("%1$-3d %2$-20.20s %|25t|%3% %|55t|%4$5s %|51t|%5$7.1f %|66t|%6$7d %|69t|%7$3d %|78t|%8$2d %|80t|%9$10d %|86t|%10$7d %|91t|%11$5.1f %|109t|%12$5.1f %|115t|%13$11d %14%");
+        fmt = boost::format("%1$-3d %2$-20.20s %|25t|%3% %|70t|%4$5s %|51t|%5$7.1f %|66t|%6$7d %|69t|%7$10d %|78t|%8$10d %|80t|%9$10d %|86t|%10$7d %|91t|%11$5.1f %|109t|%12$5.1f %|115t|%13$11d %14%");
         ret << (fmt % "#" % "Name" % "Address" % "State" % "Qps" % "Qlim" % "Ord" % "Wt" % "Queries" % "Drops" % "Drate" % "Lat" % "Outstanding" % "Pools") << endl;
       }