]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_stats.cpp
Rename `<bind:ssl>` to `<bind:sslprofile>`.
[user/henk/code/inspircd.git] / src / coremods / core_stats.cpp
index 918d59ab7dcc89b8d45c150b34ac30dd960163dd..19e429a95e92089924cc590e47ea39f69b791116 100644 (file)
@@ -1,9 +1,16 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2018 Puck Meerburg <puck@puckipedia.com>
+ *   Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw>
+ *   Copyright (C) 2016-2020 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2012 ChrisTX <xpipe@hotmail.de>
+ *   Copyright (C) 2012 Adam <Adam@anope.org>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007-2008 Craig Edwards <craigedwards@brainbox.cc>
- *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006, 2008, 2010 Craig Edwards <brain@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -110,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::string type = ls->bind_tag->getString("type", "clients");
-                               std::string hook = ls->bind_tag->getString("ssl", "plaintext");
+                               std::stringstream portentry;
 
-                               stats.AddRow(249, ls->bind_sa.str() + " (" + type + ", " + hook + ")");
+                               const std::string type = ls->bind_tag->getString("type", "clients", 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("sslprofile", ls->bind_tag->getString("ssl"));
+                               if (!sslprofile.empty())
+                                       portentry << ", ssl profile: " << sslprofile;
+
+                               portentry << ')';
+                               stats.AddRow(249, portentry.str());
                        }
                }
                break;
@@ -142,7 +160,7 @@ void CommandStats::DoStats(Stats::Context& stats)
                                else
                                        param.append(c->host);
 
-                               row.push(param).push(c->config->getString("port", "*"));
+                               row.push(param).push(c->config->getString("port", "*", 1));
                                row.push(ConvToStr(c->GetRecvqMax())).push(ConvToStr(c->GetSendqSoftMax())).push(ConvToStr(c->GetSendqHardMax())).push(ConvToStr(c->GetCommandRate()));
 
                                param = ConvToStr(c->GetPenaltyThreshold());
@@ -188,19 +206,19 @@ void CommandStats::DoStats(Stats::Context& stats)
                break;
 
                case 'k':
-                       ServerInstance->XLines->InvokeStats("K",216,stats);
+                       ServerInstance->XLines->InvokeStats("K", stats);
                break;
                case 'g':
-                       ServerInstance->XLines->InvokeStats("G",223,stats);
+                       ServerInstance->XLines->InvokeStats("G", stats);
                break;
                case 'q':
-                       ServerInstance->XLines->InvokeStats("Q",217,stats);
+                       ServerInstance->XLines->InvokeStats("Q", stats);
                break;
                case 'Z':
-                       ServerInstance->XLines->InvokeStats("Z",223,stats);
+                       ServerInstance->XLines->InvokeStats("Z", stats);
                break;
                case 'e':
-                       ServerInstance->XLines->InvokeStats("E",223,stats);
+                       ServerInstance->XLines->InvokeStats("E", stats);
                break;
                case 'E':
                {