From 7c1352df0c8bb2624d4f2cc8320467578c39a6ad Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 26 Sep 2009 17:28:25 +0000 Subject: Compile fixes and message updates git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11767 e03df62e-2008-0410-955e-edbf42e46eb7 --- conf/modules.conf.example | 21 --------------------- src/inspsocket.cpp | 5 ++++- src/modules/extra/m_regex_pcre.cpp | 4 ++-- src/modules/extra/m_regex_posix.cpp | 4 ++-- src/modules/extra/m_regex_tre.cpp | 4 ++-- src/modules/extra/m_ssl_gnutls.cpp | 2 +- src/modules/m_close.cpp | 8 ++++---- src/modules/m_securelist.cpp | 7 ------- src/socketengines/socketengine_select.cpp | 6 +++--- 9 files changed, 18 insertions(+), 43 deletions(-) diff --git a/conf/modules.conf.example b/conf/modules.conf.example index b9edaeacc..d5b4053f0 100644 --- a/conf/modules.conf.example +++ b/conf/modules.conf.example @@ -1367,27 +1367,6 @@ # RPC test module: A test of the RPC API # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Provide /LIST throttling (to prevent flooding) and /LIST safety to -# prevent excess flood when the list is large. -# -# -#-#-#-#-#-#-#-#-#-#-# SAFELIST CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-# -# -# When using Safelist, you may set the following values; -# -# The first value, 'throttle', sets the amount of time in seconds a user -# must wait between LIST commands. For example, if this is set to 60 -# (the default) then the user may not /LIST more than once a minute. -# If not defined, the default value is 60 seconds. -# -# The second value, 'maxlisters', indicates the maximum number of users -# which may be retrieving a LIST at once. It is not recommended you raise -# this value, as increasing it too high can make your network vulnerable -# to floodbots which waste your bandwidth and CPU time with LIST requests. -# -# - #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SAJOIN module: Adds the /SAJOIN command # This module is oper-only. diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 004d679ed..a46907ca5 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -437,7 +437,10 @@ void StreamSocket::HandleEvent(EventType et, int errornum) { case EVENT_ERROR: { - SetError(strerror(errornum)); + if (errornum == 0) + SetError("Connection closed"); + else + SetError(strerror(errornum)); switch (errornum) { case ETIMEDOUT: diff --git a/src/modules/extra/m_regex_pcre.cpp b/src/modules/extra/m_regex_pcre.cpp index 4389ad685..782847736 100644 --- a/src/modules/extra/m_regex_pcre.cpp +++ b/src/modules/extra/m_regex_pcre.cpp @@ -39,7 +39,7 @@ private: pcre* regex; public: - PCRERegex(const std::string& rx, ) : Regex(rx, Me) + PCRERegex(const std::string& rx) : Regex(rx) { const char* error; int erroffset; @@ -96,7 +96,7 @@ public: { RegexFactoryRequest* rfr = (RegexFactoryRequest*)request; std::string rx = rfr->GetRegex(); - rfr->result = new PCRERegex(rx, ServerInstance); + rfr->result = new PCRERegex(rx); return "OK"; } return NULL; diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp index 5fe4db29f..7afaad076 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -34,7 +34,7 @@ private: regex_t regbuf; public: - POSIXRegex(const std::string& rx, bool extended) : Regex(rx, Me) + POSIXRegex(const std::string& rx, bool extended) : Regex(rx) { int flags = (extended ? REG_EXTENDED : 0) | REG_NOSUB; int errcode; @@ -109,7 +109,7 @@ public: { RegexFactoryRequest* rfr = (RegexFactoryRequest*)request; std::string rx = rfr->GetRegex(); - rfr->result = new POSIXRegex(rx, ServerInstance, extended); + rfr->result = new POSIXRegex(rx, extended); return "OK"; } return NULL; diff --git a/src/modules/extra/m_regex_tre.cpp b/src/modules/extra/m_regex_tre.cpp index 1ed35605b..41aaec31c 100644 --- a/src/modules/extra/m_regex_tre.cpp +++ b/src/modules/extra/m_regex_tre.cpp @@ -36,7 +36,7 @@ private: regex_t regbuf; public: - TRERegex(const std::string& rx, ) : Regex(rx, Me) + TRERegex(const std::string& rx) : Regex(rx) { int flags = REG_EXTENDED | REG_NOSUB; int errcode; @@ -102,7 +102,7 @@ public: { RegexFactoryRequest* rfr = (RegexFactoryRequest*)request; std::string rx = rfr->GetRegex(); - rfr->result = new TRERegex(rx, ServerInstance); + rfr->result = new TRERegex(rx); return "OK"; } return NULL; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 1fe84649f..813ae9e9b 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -261,7 +261,7 @@ class ModuleSSLGnuTLS : public Module if((ret = gnutls_certificate_set_x509_crl_file (x509_cred, crlfile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEBUG, "m_ssl_gnutls.so: Failed to set X.509 CRL file '%s': %s", crlfile.c_str(), gnutls_strerror(ret)); - FileReader reader(ServerInstance); + FileReader reader; reader.LoadFile(certfile); std::string cert_string = reader.Contents(); diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 1cddc5012..a2e9692cd 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -33,7 +33,7 @@ class CommandClose : public Command { flags_needed = 'o'; } - CmdResult Handle (const std::vector ¶meters, User *user) + CmdResult Handle (const std::vector ¶meters, User *src) { std::map closed; @@ -52,13 +52,13 @@ class CommandClose : public Command int total = 0; for (std::map::iterator ci = closed.begin(); ci != closed.end(); ci++) { - user->WriteServ("NOTICE %s :*** Closed %d unknown connection%s from [%s]",user->nick.c_str(),(*ci).second,((*ci).second>1)?"s":"",(*ci).first.c_str()); + src->WriteServ("NOTICE %s :*** Closed %d unknown connection%s from [%s]",src->nick.c_str(),(*ci).second,((*ci).second>1)?"s":"",(*ci).first.c_str()); total += (*ci).second; } if (total) - user->WriteServ("NOTICE %s :*** %i unknown connection%s closed",user->nick.c_str(),total,(total>1)?"s":""); + src->WriteServ("NOTICE %s :*** %i unknown connection%s closed",src->nick.c_str(),total,(total>1)?"s":""); else - user->WriteServ("NOTICE %s :*** No unknown connections found",user->nick.c_str()); + src->WriteServ("NOTICE %s :*** No unknown connections found",src->nick.c_str()); return CMD_SUCCESS; } diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index 5e2d704bb..a83e9dc1b 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -82,13 +82,6 @@ class ModuleSecureList : public Module { output.append(" SECURELIST"); } - - void Prioritize() - { - Module* safelist = ServerInstance->Modules->Find("m_safelist.so"); - ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_BEFORE, &safelist); - } - }; MODULE_INIT(ModuleSecureList) diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index eacfc0fbf..b35558a70 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -32,7 +32,7 @@ SelectEngine::~SelectEngine() delete[] ref; } -bool SelectEngine::AddFd(EventHandler* eh, int) +bool SelectEngine::AddFd(EventHandler* eh, int event_mask) { int fd = eh->GetFd(); if ((fd < 0) || (fd > GetMaxFds() - 1)) @@ -128,13 +128,13 @@ int SelectEngine::DispatchEvents() if (FD_ISSET (i, &rfdset)) { ReadEvents++; - SetEventMask(eh, eh->GetEventMask() & ~FD_READ_WILL_BLOCK); + SetEventMask(ev, ev->GetEventMask() & ~FD_READ_WILL_BLOCK); ev->HandleEvent(EVENT_READ); } if (FD_ISSET (i, &wfdset)) { WriteEvents++; - SetEventMask(eh, eh->GetEventMask() & ~(FD_WRITE_WILL_BLOCK | FD_WANT_SINGLE_WRITE)); + SetEventMask(ev, ev->GetEventMask() & ~(FD_WRITE_WILL_BLOCK | FD_WANT_SINGLE_WRITE)); ev->HandleEvent(EVENT_WRITE); } } -- cgit v1.2.3