X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_httpd_stats.cpp;h=6db292eb37c7fe8ae3fd56f90eaf5781dd1a48e6;hb=be0c4f6a3c0e65435f211d817270073dce047396;hp=ad0b4bb72caac277ebda2d9ed21226c54515e8df;hpb=ae6967b8b30ebc956e3158127ecba5d01dc09204;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index ad0b4bb72..6db292eb3 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -97,22 +97,24 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) { - data << "" << ServerInstance->Config->ServerName << "" - << Sanitize(ServerInstance->Config->ServerDesc) << "" + data << "" << ServerInstance->Config->ServerName << "" + << Sanitize(ServerInstance->Config->ServerDesc) << "" << Sanitize(ServerInstance->GetVersionString()) << ""; data << ""; data << "" << ServerInstance->Users->GetUsers().size() << ""; data << "" << ServerInstance->GetChans().size() << ""; data << "" << ServerInstance->Users->all_opers.size() << ""; - data << "" << (SocketEngine::GetUsedFds()) << "" << SocketEngine::GetMaxFds() << "" INSPIRCD_SOCKETENGINE_NAME ""; + data << "" << (SocketEngine::GetUsedFds()) << "" << SocketEngine::GetMaxFds() << ""; data << "" << ServerInstance->startup_time << ""; data << ""; - const std::vector& isupport = ServerInstance->ISupport.GetLines(); - for (std::vector::const_iterator it = isupport.begin(); it != isupport.end(); it++) + const std::vector& isupport = ServerInstance->ISupport.GetLines(); + for (std::vector::const_iterator i = isupport.begin(); i != isupport.end(); ++i) { - data << Sanitize(*it) << std::endl; + const Numeric::Numeric& num = *i; + for (std::vector::const_iterator j = num.GetParams().begin(); j != num.GetParams().end()-1; ++j) + data << "" << Sanitize(*j) << "" << std::endl; } data << ""; std::vector xltypes = ServerInstance->XLines->GetAllTypes(); @@ -181,13 +183,13 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener data << ""; data << "" << u->nick << "" << u->uuid << "" - << u->host << "" << u->dhost << "" - << Sanitize(u->fullname) << "" << u->server->GetName() << ""; + << u->GetRealHost() << "" << u->GetDisplayedHost() << "" + << Sanitize(u->GetRealName()) << "" << u->server->GetName() << ""; if (u->IsAway()) data << "" << Sanitize(u->awaymsg) << "" << u->awaytime << ""; if (u->IsOper()) data << "" << Sanitize(u->oper->name) << ""; - data << "" << u->FormatModes() << "" << Sanitize(u->ident) << ""; + data << "" << u->GetModeLetters().substr(1) << "" << Sanitize(u->ident) << ""; LocalUser* lu = IS_LOCAL(u); if (lu) data << "" << lu->GetServerPort() << "" @@ -209,7 +211,7 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener data << ""; data << "" << b->servername << ""; data << "" << b->parentname << ""; - data << "" << b->gecos << ""; + data << "" << Sanitize(b->description) << ""; data << "" << b->usercount << ""; // This is currently not implemented, so, commented out. // data << "" << b->opercount << ""; @@ -217,7 +219,15 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener data << ""; } - data << ""; + data << ""; + + const CommandParser::CommandMap& commands = ServerInstance->Parser.GetCommands(); + for (CommandParser::CommandMap::const_iterator i = commands.begin(); i != commands.end(); ++i) + { + data << "" << i->second->name << "" << i->second->use_count << ""; + } + + data << ""; /* Send the document back to m_httpd */ HTTPDocumentResponse response(this, *http, &data, 200); @@ -237,7 +247,7 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener Version GetVersion() CXX11_OVERRIDE { - return Version("Provides statistics over HTTP via m_httpd.so", VF_VENDOR); + return Version("Provides statistics over HTTP via m_httpd", VF_VENDOR); } };