diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inspsocket.cpp | 5 | ||||
-rw-r--r-- | src/modules/extra/m_regex_pcre.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_regex_posix.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_regex_tre.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_close.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_securelist.cpp | 7 | ||||
-rw-r--r-- | src/socketengines/socketengine_select.cpp | 6 |
8 files changed, 18 insertions, 22 deletions
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<std::string> ¶meters, User *user) + CmdResult Handle (const std::vector<std::string> ¶meters, User *src) { std::map<std::string,int> closed; @@ -52,13 +52,13 @@ class CommandClose : public Command int total = 0; for (std::map<std::string,int>::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); } } |