summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-30 19:54:47 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-30 19:54:47 +0000
commit55b81f917cd313a8814d3364048af0036b41a2ca (patch)
tree2f3b56b0cc3207aef05dccf08dbf9a57ddaa6056
parentfa2cdd0bb89330cfd9a6c49c4705da2a3cb02834 (diff)
Clean up typos and some unused code
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11980 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/commands/cmd_whowas.h4
-rw-r--r--src/commands/cmd_whowas.cpp3
-rw-r--r--src/modules/m_blockamsg.cpp4
-rw-r--r--src/modules/m_httpd_stats.cpp33
-rw-r--r--src/modules/ssl.h5
-rw-r--r--src/stats.cpp3
6 files changed, 26 insertions, 26 deletions
diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h
index 71c635b39..4031ce6db 100644
--- a/include/commands/cmd_whowas.h
+++ b/include/commands/cmd_whowas.h
@@ -72,10 +72,6 @@ class CommandWhowas : public Command
*/
whowas_users_fifo whowas_fifo;
- /* String holding stats so it can be collected
- */
- std::string stats;
-
public:
CommandWhowas(Module* parent);
/** Handle command.
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 << "<inspircdstats>";
-
- data << "<server><name>" << ServerInstance->Config->ServerName << "</name><gecos>"
+ data << "<inspircdstats><server><name>" << ServerInstance->Config->ServerName << "</name><gecos>"
<< Sanitize(ServerInstance->Config->ServerDesc) << "</gecos><version>"
<< Sanitize(ServerInstance->GetVersionString()) << "</version></server>";
@@ -111,8 +110,25 @@ class ModuleHttpStats : public Module
stime = gmtime(&server_uptime);
data << "<uptime><days>" << stime->tm_yday << "</days><hours>" << stime->tm_hour << "</hours><mins>" << stime->tm_min << "</mins><secs>" << stime->tm_sec << "</secs><boot_time_t>" << ServerInstance->startup_time << "</boot_time_t></uptime>";
- data << "<isupport>" << Sanitize(ServerInstance->Config->data005) << "</isupport></general>";
- data << "<modulelist>";
+ data << "<isupport>" << Sanitize(ServerInstance->Config->data005) << "</isupport></general><xlines>";
+ std::vector<std::string> xltypes = ServerInstance->XLines->GetAllTypes();
+ for (std::vector<std::string>::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 << "<xline type=\"" << it->c_str() << "\"><mask>"
+ << Sanitize(i->second->Displayable()) << "</mask><settime>"
+ << i->second->set_time << "</settime><duration>" << i->second->duration
+ << "</duration><reason>" << Sanitize(i->second->reason)
+ << "</reason></xline>";
+ }
+ }
+
+ data << "</xlines><modulelist>";
std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
for (std::vector<std::string>::iterator i = module_names.begin(); i != module_names.end(); ++i)
@@ -121,8 +137,7 @@ class ModuleHttpStats : public Module
Version v = m->GetVersion();
data << "<module><name>" << *i << "</name><version>" << v.version << "</version><description>" << Sanitize(v.description) << "</description></module>";
}
- data << "</modulelist>";
- data << "<channellist>";
+ data << "</modulelist><channellist>";
for (chan_hash::const_iterator a = ServerInstance->chanlist->begin(); a != ServerInstance->chanlist->end(); ++a)
{
@@ -197,9 +212,7 @@ class ModuleHttpStats : public Module
data << "</server>";
}
- data << "</serverlist>";
-
- data << "</inspircdstats>";
+ data << "</serverlist></inspircdstats>";
/* 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];