From 55b81f917cd313a8814d3364048af0036b41a2ca Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 30 Oct 2009 19:54:47 +0000 Subject: Clean up typos and some unused code git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11980 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_whowas.cpp | 3 +-- src/modules/m_blockamsg.cpp | 4 ++-- src/modules/m_httpd_stats.cpp | 33 +++++++++++++++++++++++---------- src/modules/ssl.h | 5 ----- src/stats.cpp | 3 --- 5 files changed, 26 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index a11b02b2d..34e7e74e0 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -97,8 +97,7 @@ std::string CommandWhowas::GetStats() whowas_bytes += (sizeof(whowas_set) + ( sizeof(WhoWasGroup) * n->size() ) ); } } - stats.assign("Whowas(MAPSETS) " +ConvToStr(whowas_size)+" ("+ConvToStr(whowas_bytes)+" bytes)"); - return stats; + return "Whowas entries: " +ConvToStr(whowas_size)+" ("+ConvToStr(whowas_bytes)+" bytes)"; } void CommandWhowas::AddToWhoWas(User* user) diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 8891e306d..41701f3a6 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -141,9 +141,9 @@ class ModuleBlockAmsg : public Module ServerInstance->SNO->WriteToSnoMask('a', "%s had an /amsg or /ame denied", user->nick.c_str()); if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS) - ServerInstance->Users->QuitUser(user, "Global message (/amsg or /ame) detected"); + ServerInstance->Users->QuitUser(user, "Attempted to global message (/amsg or /ame)"); else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS) - user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick.c_str()); + user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) denied", user->nick.c_str()); return MOD_RES_DENY; } diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index a0aa202ab..36deda11b 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -13,6 +13,7 @@ #include "inspircd.h" #include "httpd.h" +#include "xline.h" #include "protocol.h" /* $ModDesc: Provides statistics over HTTP via m_httpd.so */ @@ -92,9 +93,7 @@ class ModuleHttpStats : public Module if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) { - data << ""; - - data << "" << ServerInstance->Config->ServerName << "" + data << "" << ServerInstance->Config->ServerName << "" << Sanitize(ServerInstance->Config->ServerDesc) << "" << Sanitize(ServerInstance->GetVersionString()) << ""; @@ -111,8 +110,25 @@ class ModuleHttpStats : public Module stime = gmtime(&server_uptime); data << "" << stime->tm_yday << "" << stime->tm_hour << "" << stime->tm_min << "" << stime->tm_sec << "" << ServerInstance->startup_time << ""; - data << "" << Sanitize(ServerInstance->Config->data005) << ""; - data << ""; + data << "" << Sanitize(ServerInstance->Config->data005) << ""; + std::vector xltypes = ServerInstance->XLines->GetAllTypes(); + for (std::vector::iterator it = xltypes.begin(); it != xltypes.end(); ++it) + { + XLineLookup* lookup = ServerInstance->XLines->GetAll(*it); + + if (!lookup) + continue; + for (LookupIter i = lookup->begin(); i != lookup->end(); ++i) + { + data << "c_str() << "\">" + << Sanitize(i->second->Displayable()) << "" + << i->second->set_time << "" << i->second->duration + << "" << Sanitize(i->second->reason) + << ""; + } + } + + data << ""; std::vector module_names = ServerInstance->Modules->GetAllModuleNames(0); for (std::vector::iterator i = module_names.begin(); i != module_names.end(); ++i) @@ -121,8 +137,7 @@ class ModuleHttpStats : public Module Version v = m->GetVersion(); data << "" << *i << "" << v.version << "" << Sanitize(v.description) << ""; } - data << ""; - data << ""; + data << ""; for (chan_hash::const_iterator a = ServerInstance->chanlist->begin(); a != ServerInstance->chanlist->end(); ++a) { @@ -197,9 +212,7 @@ class ModuleHttpStats : public Module data << ""; } - data << ""; - - data << ""; + data << ""; /* Send the document back to m_httpd */ HTTPDocumentResponse response(this, *http, &data, 200); diff --git a/src/modules/ssl.h b/src/modules/ssl.h index 3bc78cf98..68f1910ff 100644 --- a/src/modules/ssl.h +++ b/src/modules/ssl.h @@ -122,11 +122,6 @@ struct SSLCertificateRequest : public Request { Extensible* const item; ssl_cert* cert; - SSLCertificateRequest(StreamSocket* ss, Module* Me) - : Request(Me, ss->GetIOHook(), "GET_CERT"), item(ss), cert(NULL) - { - Send(); - } SSLCertificateRequest(Extensible* e, Module* Me, Module* info = ServerInstance->Modules->Find("m_sslinfo.so")) : Request(Me, info, "GET_CERT"), item(e), cert(NULL) diff --git a/src/stats.cpp b/src/stats.cpp index decdfe36e..fa11758f9 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -150,7 +150,6 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) /* stats z (debug and memory info) */ case 'z': { - results.push_back(sn+" 240 "+user->nick+" :InspIRCd: "+ConvToStr(sizeof(InspIRCd))+" bytes"); results.push_back(sn+" 249 "+user->nick+" :Users: "+ConvToStr(this->Users->clientlist->size())); results.push_back(sn+" 249 "+user->nick+" :Channels: "+ConvToStr(this->chanlist->size())); results.push_back(sn+" 249 "+user->nick+" :Commands: "+ConvToStr(this->Parser->cmdlist.size())); @@ -167,8 +166,6 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) } } - results.push_back(sn+" 249 "+user->nick+" :MOTD "+ConvToStr(this->Config->MOTD.size())+", RULES "+ConvToStr(this->Config->RULES.size())); - float kbitpersec_in, kbitpersec_out, kbitpersec_total; char kbitpersec_in_s[30], kbitpersec_out_s[30], kbitpersec_total_s[30]; -- cgit v1.2.3