diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hashcomp.cpp | 2 | ||||
-rw-r--r-- | src/inspircd.cpp | 2 | ||||
-rw-r--r-- | src/inspsocket.cpp | 3 | ||||
-rw-r--r-- | src/listensocket.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_filter.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_globalload.cpp | 21 | ||||
-rw-r--r-- | src/modules/m_spanningtree/idle.cpp (renamed from src/modules/m_spanningtree/whois.cpp) | 0 | ||||
-rw-r--r-- | src/modules/m_spanningtree/link.h | 1 | ||||
-rw-r--r-- | src/modules/m_watch.cpp | 2 | ||||
-rw-r--r-- | src/socket.cpp | 7 |
10 files changed, 36 insertions, 11 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 0ef8d025f..b3b00248f 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -144,7 +144,7 @@ void nspace::strlower(char *n) #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) size_t nspace::hash_compare<irc::string, std::less<irc::string> >::operator()(const irc::string &s) const #else - size_t CoreExport nspace::hash<irc::string>::operator()(const irc::string &s) const + size_t CoreExport irc::hash::operator()(const irc::string &s) const #endif { register size_t t = 0; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 47a9fabba..2ac844bb6 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -615,7 +615,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : } #else WindowsIPC = new IPC; - if(!Config->nofork) + if(!Config->cmdline.nofork) { WindowsForkKillOwner(); FreeConsole(); diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 92625ac29..b872ea7e6 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -18,10 +18,11 @@ #ifndef DISABLE_WRITEV #include <sys/uio.h> +#endif + #ifndef IOV_MAX #define IOV_MAX 1024 #endif -#endif BufferedSocket::BufferedSocket() { diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 0bd6cb92b..df27a9c48 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -41,7 +41,7 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t if (bind_to.sa.sa_family == AF_INET6) { std::string addr = tag->getString("address"); - int enable = (addr.empty() || addr == "*") ? 0 : 1; + const char enable = (addr.empty() || addr == "*") ? 0 : 1; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &enable, sizeof(enable)); // errors ignored intentionally } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 69117ae55..e4b2645f9 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -165,7 +165,8 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User if (parameters.size() == 1) { /* Deleting a filter */ - if (static_cast<ModuleFilter&>(*creator).DeleteFilter(parameters[0])) + Module *me = creator; + if (static_cast<ModuleFilter *>(me)->DeleteFilter(parameters[0])) { user->WriteServ("NOTICE %s :*** Removed filter '%s'", user->nick.c_str(), parameters[0].c_str()); ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', std::string("FILTER: ")+user->nick+" removed filter '"+parameters[0]+"'"); @@ -212,7 +213,9 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User { reason = parameters[3]; } - std::pair<bool, std::string> result = static_cast<ModuleFilter&>(*creator).AddFilter(freeform, type, reason, duration, flags); + + Module *me = creator; + std::pair<bool, std::string> result = static_cast<ModuleFilter *>(me)->AddFilter(freeform, type, reason, duration, flags); if (result.first) { user->WriteServ("NOTICE %s :*** Added filter '%s', type '%s'%s%s, flags '%s', reason: '%s'", user->nick.c_str(), freeform.c_str(), diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index be29b00a5..c9a4231dd 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -96,6 +96,25 @@ class CommandGunloadmodule : public Command } }; +class GReloadModuleWorker : public HandlerBase1<void, bool> +{ + public: + const std::string nick; + const std::string name; + const std::string uid; + GReloadModuleWorker(const std::string& usernick, const std::string& uuid, const std::string& modn) + : nick(usernick), name(modn), uid(uuid) {} + void Call(bool result) + { + ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY RELOADED BY '%s'%s", name.c_str(), nick.c_str(), result ? "" : " (failed here)"); + User* user = ServerInstance->FindNick(uid); + if (user) + user->WriteNumeric(975, "%s %s :Module %ssuccessfully reloaded.", + user->nick.c_str(), name.c_str(), result ? "" : "un"); + ServerInstance->GlobalCulls.AddItem(this); + } +}; + /** Handle /GRELOADMODULE */ class CommandGreloadmodule : public Command @@ -114,7 +133,7 @@ class CommandGreloadmodule : public Command { Module* m = ServerInstance->Modules->Find(parameters[0]); if (m) - ServerInstance->Modules->Reload(m, NULL); + ServerInstance->Modules->Reload(m, new GReloadModuleWorker(user->nick, user->uuid, parameters[0])); else { user->WriteNumeric(975, "%s %s :Could not find module by that name", user->nick.c_str(), parameters[0].c_str()); diff --git a/src/modules/m_spanningtree/whois.cpp b/src/modules/m_spanningtree/idle.cpp index 59dc83985..59dc83985 100644 --- a/src/modules/m_spanningtree/whois.cpp +++ b/src/modules/m_spanningtree/idle.cpp diff --git a/src/modules/m_spanningtree/link.h b/src/modules/m_spanningtree/link.h index 0ff2593cc..c60cb0bb7 100644 --- a/src/modules/m_spanningtree/link.h +++ b/src/modules/m_spanningtree/link.h @@ -45,5 +45,4 @@ class Autoconnect : public refcountbase Autoconnect(ConfigTag* Tag) : tag(Tag) {} }; - #endif diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 78da2799b..9a9e12bb1 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -90,7 +90,7 @@ #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries; #else - typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries; + typedef nspace::hash_map<irc::string, std::deque<User*>, irc::hash> watchentries; #endif typedef std::map<irc::string, std::string> watchlist; diff --git a/src/socket.cpp b/src/socket.cpp index a04523ddf..22c320b24 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -338,8 +338,11 @@ bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const bool irc::sockets::cidr_mask::operator<(const cidr_mask& other) const { - return type < other.type || length < other.length || - memcmp(bits, other.bits, 16) < 0; + if (type != other.type) + return type < other.type; + if (length != other.length) + return length < other.length; + return memcmp(bits, other.bits, 16) < 0; } bool irc::sockets::cidr_mask::match(const irc::sockets::sockaddrs& addr) const |