]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix the `STATS p` output being ambiguous.
authorSadie Powell <sadie@witchery.services>
Mon, 8 Mar 2021 13:22:13 +0000 (13:22 +0000)
committerSadie Powell <sadie@witchery.services>
Mon, 8 Mar 2021 13:22:13 +0000 (13:22 +0000)
- Add the middle I/O hook to the stats output.
- Make it obvious what the various fields actually are.

src/coremods/core_stats.cpp

index 9dddcb3a5f3df353ee727cde907d1729a28b9766..d6703872e7aaede3e82af64a2471223db2469ec4 100644 (file)
@@ -117,10 +117,21 @@ void CommandStats::DoStats(Stats::Context& stats)
                        for (std::vector<ListenSocket*>::const_iterator i = ServerInstance->ports.begin(); i != ServerInstance->ports.end(); ++i)
                        {
                                ListenSocket* ls = *i;
+                               std::stringstream portentry;
+
                                const std::string type = ls->bind_tag->getString("type", "clients", 1);
-                               const std::string hook = ls->bind_tag->getString("ssl", "plaintext", 1);
+                               portentry << ls->bind_sa.str() << " (type: " << type;
+
+                               const std::string hook = ls->bind_tag->getString("hook");
+                               if (!hook.empty())
+                                       portentry << ", hook: " << hook;
+
+                               const std::string sslprofile = ls->bind_tag->getString("ssl");
+                               if (!sslprofile.empty())
+                                       portentry << ", ssl profile: " << sslprofile;
 
-                               stats.AddRow(249, ls->bind_sa.str() + " (" + type + ", " + hook + ")");
+                               portentry << ')';
+                               stats.AddRow(249, portentry.str());
                        }
                }
                break;