diff options
-rwxr-xr-x | Config | 2 | ||||
-rw-r--r-- | data/example.conf | 3 | ||||
-rw-r--r-- | docs/INSTALL | 8 | ||||
-rw-r--r-- | include/commands.h | 2 | ||||
-rw-r--r-- | include/hashcomp.h | 4 | ||||
-rw-r--r-- | include/services.h | 2 | ||||
-rw-r--r-- | include/sockets.h | 2 | ||||
-rw-r--r-- | include/version.cpp | 2 | ||||
-rw-r--r-- | modules/CMakeLists.txt | 8 | ||||
-rw-r--r-- | modules/core/cs_xop.cpp | 2 | ||||
-rw-r--r-- | modules/core/db_plain.cpp | 6 | ||||
-rw-r--r-- | modules/core/ns_register.cpp | 2 | ||||
-rw-r--r-- | modules/extra/db_mysql.cpp | 4 | ||||
-rw-r--r-- | modules/extra/m_alias.cpp | 2 | ||||
-rw-r--r-- | modules/socketengines/m_socketengine_epoll.cpp | 6 | ||||
-rw-r--r-- | modules/socketengines/m_socketengine_poll.cpp | 192 | ||||
-rw-r--r-- | src/bots.cpp | 8 | ||||
-rw-r--r-- | src/chanserv.cpp | 4 | ||||
-rw-r--r-- | src/modules.cpp | 3 | ||||
-rw-r--r-- | src/nickcore.cpp | 4 | ||||
-rw-r--r-- | src/operserv.cpp | 11 | ||||
-rw-r--r-- | src/regchannel.cpp | 4 |
22 files changed, 239 insertions, 42 deletions
@@ -171,7 +171,7 @@ if [ ! "$NO_INTRO" ] ; then # Only do this if we are not on a tag, src/version.sh will be all we need then. if [ "$VERSION_BUILD" != "$VERSION_EXTRA" ] ; then echo "#define VERSION_BUILD $VERSION_BUILD" > include/version.h - echo "#define VERSION_EXTRA \"$VERSION_EXTRA\"" >> include/version.h + echo "#define VERSION_EXTRA \"-$VERSION_EXTRA\"" >> include/version.h fi fi cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER diff --git a/data/example.conf b/data/example.conf index ddbdbbc42..174a0f8a8 100644 --- a/data/example.conf +++ b/data/example.conf @@ -283,11 +283,12 @@ options * * Supported: * - m_socketengine_select + * - m_socketengine_poll * - m_socketengine_epoll * * We recommend using epoll if your operating system supports it (Linux 2.6+). */ - socketengine = "m_socketengine_select" + socketengine = "m_socketengine_poll" /* * The maximum length of passwords diff --git a/docs/INSTALL b/docs/INSTALL index 3883f5a51..e011470b5 100644 --- a/docs/INSTALL +++ b/docs/INSTALL @@ -185,16 +185,16 @@ Note: You should also read the README and FAQ files! modification. First rename the example.chk script that is in Anope path (by default, - this is ~/services) to services.chk and edit it. You'll need to modify - the CONFIGURATION part of the file. Then ensure that the file is marked - as executable by typing chmod +x services.chk, and try to launch the + this is ~/services/data) to services.chk and edit it. You'll need to + modify the CONFIGURATION part of the file. Then ensure that the file is + marked as executable by typing chmod +x services.chk, and try to launch the script to see if it works (Anope must not be running when you do this ;)) When this is done, you'll have to add the crontab entry. Type crontab -e. This will open the default text editor with the crontab file. Enter the following (with correct path): - */5 * * * * /home/ircd/services/services.chk >/dev/null 2>&1 + */5 * * * * /home/ircd/services/data/services.chk >/dev/null 2>&1 The */5 at the beginning means "check every 5 minutes". You may replace the 5 with other another number if you want (but less than 60). Consult diff --git a/include/commands.h b/include/commands.h index 6c7ef7494..f05b1a5db 100644 --- a/include/commands.h +++ b/include/commands.h @@ -44,7 +44,7 @@ enum CommandFlag }; /* The source for a command */ -struct CommandSource +struct CoreExport CommandSource { /* User executing the command */ User *u; diff --git a/include/hashcomp.h b/include/hashcomp.h index b99b97aa4..fa502b498 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -176,7 +176,7 @@ namespace irc /** Used to hash irc::strings for unordered_map */ - struct hash + struct CoreExport hash { /* VS 2008 specific code */ enum { bucket_size = 4, min_buckets = 8 }; @@ -253,7 +253,7 @@ namespace ci /** Used to hash ci::strings for unordered_map */ - struct hash + struct CoreExport hash { /* VS 2008 specific code */ enum { bucket_size = 4, min_buckets = 8 }; diff --git a/include/services.h b/include/services.h index d86729e51..5448d9170 100644 --- a/include/services.h +++ b/include/services.h @@ -765,7 +765,7 @@ enum EntryType ENTRYTYPE_HOST }; -class Entry : public Flags<EntryType> +class CoreExport Entry : public Flags<EntryType> { Anope::string mask; diff --git a/include/sockets.h b/include/sockets.h index c9e5bfed0..d5457cf05 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -340,7 +340,7 @@ class CoreExport ConnectionSocket : public BufferedSocket void Connect(const Anope::string &TargetHost, int Port, const Anope::string &BindHost = ""); }; -class ClientSocket : public BufferedSocket +class CoreExport ClientSocket : public BufferedSocket { public: /* Listen socket this connection came from */ diff --git a/include/version.cpp b/include/version.cpp index 9b8f38c45..8cf362726 100644 --- a/include/version.cpp +++ b/include/version.cpp @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) for (std::list<std::pair<std::string, std::string> >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it) { if (it->first == "EXTRA") - fd << "#define VERSION_EXTRA \"" << (!version_extra.empty() ? version_extra : "") << it->second << "\"" << std::endl; + fd << "#define VERSION_EXTRA \"" << (!version_extra.empty() ? version_extra : "") << (version_extra.find(it->second) == std::string::npos ? it->second : "") << "\"" << std::endl; else fd << "#define VERSION_" << it->first << " " << it->second << std::endl; } diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 9e094b40c..a9a73e775 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -76,9 +76,9 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) endif(WIN32) set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}") add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version + # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES}) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES}) set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") endif(WIN32) # Set the module to be installed to the module directory under the data directory @@ -170,9 +170,9 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS}) set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}") add_dependencies(${SO} ${PROGRAM_NAME}) - # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version + # For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version if(WIN32) - target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS}) + target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS}) set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") endif(WIN32) # Set the module to be installed to the module directory under the data directory diff --git a/modules/core/cs_xop.cpp b/modules/core/cs_xop.cpp index 1d1ec7c84..6ab6edff8 100644 --- a/modules/core/cs_xop.cpp +++ b/modules/core/cs_xop.cpp @@ -316,7 +316,7 @@ class XOPBase : public Command XOPDelCallback list(source, this, messages, override, mask); list.Process(); } - else if (!access) + else if (!access || access->level != level) { source.Reply(messages[XOP_NOT_FOUND], mask.c_str(), ci->name.c_str()); return MOD_CONT; diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp index 44058d5e5..97ac75bde 100644 --- a/modules/core/db_plain.cpp +++ b/modules/core/db_plain.cpp @@ -980,7 +980,7 @@ class DBPlain : public Module db << " " << oldmodes; else { - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; if (ml.set) @@ -1003,7 +1003,7 @@ class DBPlain : public Module } else { - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; if (!ml.set) @@ -1028,7 +1028,7 @@ class DBPlain : public Module } else { - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name); diff --git a/modules/core/ns_register.cpp b/modules/core/ns_register.cpp index edf8181e5..31f99540a 100644 --- a/modules/core/ns_register.cpp +++ b/modules/core/ns_register.cpp @@ -213,7 +213,7 @@ class CommandNSRegister : public CommandNSConfirm /* Guest nick can now have a series of between 1 and 7 digits. * --lara */ - if (nicklen <= prefixlen + 7 && nicklen >= prefixlen + 1 && !u->nick.find_ci(Config->NSGuestNickPrefix) && !u->nick.substr(prefixlen).find_first_not_of("1234567890")) + if (nicklen <= prefixlen + 7 && nicklen >= prefixlen + 1 && !u->nick.find_ci(Config->NSGuestNickPrefix) && u->nick.substr(prefixlen).find_first_not_of("1234567890") == Anope::string::npos) { source.Reply(NICK_CANNOT_BE_REGISTERED, u->nick.c_str()); return MOD_CONT; diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index 07135757c..3cc0ceacb 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -206,7 +206,7 @@ static Anope::string MakeMLock(ChannelInfo *ci, bool status) ; else { - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; if (ml.set == status) @@ -249,7 +249,7 @@ static Anope::string GetMLockParams(ChannelInfo *ci, bool onoff) } else { - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; diff --git a/modules/extra/m_alias.cpp b/modules/extra/m_alias.cpp index f1b6c3959..8e73bacd9 100644 --- a/modules/extra/m_alias.cpp +++ b/modules/extra/m_alias.cpp @@ -62,7 +62,7 @@ class ModuleAlias : public Module EventReturn OnPreCommandRun(User *&u, BotInfo *&bi, Anope::string &command, Anope::string &message, ChannelInfo *&ci) { bool fantasy = ci != NULL; - std::map<Anope::string, CommandAlias, std::less<ci::string> >::const_iterator it = aliases.find(command), it_end = it; + std::multimap<Anope::string, CommandAlias, std::less<ci::string> >::const_iterator it = aliases.find(command), it_end = it; if (it_end != aliases.end()) it_end = aliases.upper_bound(command); for (; it != it_end; ++it) diff --git a/modules/socketengines/m_socketengine_epoll.cpp b/modules/socketengines/m_socketengine_epoll.cpp index 7ec380109..4a228a694 100644 --- a/modules/socketengines/m_socketengine_epoll.cpp +++ b/modules/socketengines/m_socketengine_epoll.cpp @@ -10,12 +10,10 @@ class SocketEngineEPoll : public SocketEngineBase long max; int EngineHandle; epoll_event *events; - unsigned SocketCount; public: SocketEngineEPoll() { - SocketCount = 0; max = ulimit(4, 0); if (max <= 0) @@ -57,8 +55,6 @@ class SocketEngineEPoll : public SocketEngineBase } Sockets.insert(std::make_pair(ev.data.fd, s)); - - ++SocketCount; } void DelSocket(Socket *s) @@ -76,8 +72,6 @@ class SocketEngineEPoll : public SocketEngineBase } Sockets.erase(ev.data.fd); - - --SocketCount; } void MarkWritable(Socket *s) diff --git a/modules/socketengines/m_socketengine_poll.cpp b/modules/socketengines/m_socketengine_poll.cpp new file mode 100644 index 000000000..044a79c4f --- /dev/null +++ b/modules/socketengines/m_socketengine_poll.cpp @@ -0,0 +1,192 @@ +#include "module.h" + +#ifndef _WIN32 +# include <ulimit.h> +# include <sys/poll.h> +# include <poll.h> +# ifndef POLLRDHUP +# define POLLRDHUP 0 +# endif +#else +# define poll WSAPoll +# define POLLRDHUP POLLHUP +#endif + +class SocketEnginePoll : public SocketEngineBase +{ + private: + long max; + pollfd *events; + int SocketCount; + std::map<int, int> socket_positions; + + public: + SocketEnginePoll() + { + SocketCount = 0; +#ifndef _WIN32 + max = ulimit(4, 0); +#else + max = 1024; +#endif + + if (max <= 0) + { + Log() << "Can't determine maximum number of open sockets"; + throw ModuleException("Can't determine maximum number of open sockets"); + } + + events = new pollfd[max]; + } + + ~SocketEnginePoll() + { + delete [] events; + } + + void AddSocket(Socket *s) + { + if (SocketCount == max) + { + Log() << "Unable to add fd " << s->GetFD() << " to socketengine poll, engine is full"; + return; + } + + pollfd *ev = &this->events[SocketCount]; + ev->fd = s->GetFD(); + ev->events = POLLIN; + ev->revents = 0; + + Sockets.insert(std::make_pair(ev->fd, s)); + socket_positions.insert(std::make_pair(ev->fd, SocketCount)); + + ++SocketCount; + } + + void DelSocket(Socket *s) + { + std::map<int, int>::iterator pos = socket_positions.find(s->GetFD()); + if (pos == socket_positions.end()) + { + Log() << "Unable to delete unknown fd " << s->GetFD() << " from socketengine poll"; + return; + } + + if (pos->second != SocketCount) + { + pollfd *ev = &this->events[pos->second], + *last_ev = &this->events[SocketCount - 1]; + + ev->fd = last_ev->fd; + ev->events = last_ev->events; + ev->revents = last_ev->revents; + + socket_positions[ev->fd] = pos->second; + } + + Sockets.erase(s->GetFD()); + this->socket_positions.erase(pos); + + --SocketCount; + } + + void MarkWritable(Socket *s) + { + if (s->HasFlag(SF_WRITABLE)) + return; + + std::map<int, int>::iterator pos = socket_positions.find(s->GetFD()); + if (pos == socket_positions.end()) + { + Log() << "Unable to mark unknown fd " << s->GetFD() << " as writable"; + return; + } + + pollfd *ev = &this->events[pos->second]; + ev->events |= POLLOUT; + + s->SetFlag(SF_WRITABLE); + } + + void ClearWritable(Socket *s) + { + if (!s->HasFlag(SF_WRITABLE)) + return; + + std::map<int, int>::iterator pos = socket_positions.find(s->GetFD()); + if (pos == socket_positions.end()) + { + Log() << "Unable to mark unknown fd " << s->GetFD() << " as writable"; + return; + } + + pollfd *ev = &this->events[pos->second]; + ev->events &= ~POLLOUT; + + s->UnsetFlag(SF_WRITABLE); + } + + void Process() + { + int total = poll(this->events, this->SocketCount, Config->ReadTimeout * 1000); + Anope::CurTime = time(NULL); + + if (total == -1) + { + Log() << "SockEngine::Process(): error: " << Anope::LastError(); + return; + } + + for (int i = 0; i < total; ++i) + { + pollfd *ev = &this->events[i]; + Socket *s = Sockets[ev->fd]; + + if (s->HasFlag(SF_DEAD)) + continue; + if (ev->revents & (POLLERR | POLLRDHUP)) + { + s->ProcessError(); + s->SetFlag(SF_DEAD); + continue; + } + + if ((ev->revents & POLLIN) && !s->ProcessRead()) + s->SetFlag(SF_DEAD); + + if ((ev->revents & POLLOUT) && !s->ProcessWrite()) + s->SetFlag(SF_DEAD); + } + + for (int i = 0; i < total; ++i) + { + pollfd *ev = &this->events[i]; + Socket *s = Sockets[ev->fd]; + + if (s->HasFlag(SF_DEAD)) + delete s; + } + } +}; + +class ModuleSocketEnginePoll : public Module +{ + SocketEnginePoll engine; + + public: + ModuleSocketEnginePoll(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) + { + this->SetAuthor("Anope"); + this->SetPermanent(true); + this->SetType(SOCKETENGINE); + + SocketEngine = &engine; + } + + ~ModuleSocketEnginePoll() + { + SocketEngine = NULL; + } +}; + +MODULE_INIT(ModuleSocketEnginePoll) diff --git a/src/bots.cpp b/src/bots.cpp index 87a646923..07ea91b3a 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -72,6 +72,14 @@ BotInfo::~BotInfo() ci->bi = NULL; } + for (CommandMap::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it) + { + Command *c = it->second; + + if (c->module) + c->module->DelCommand(this, c); + } + BotListByNick.erase(this->nick); if (!this->uid.empty()) BotListByUID.erase(this->uid); diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 504bdea2a..35fd8975c 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -111,7 +111,7 @@ Anope::string get_mlock_modes(ChannelInfo *ci, int complete) { Anope::string pos = "+", neg = "-", params; - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name); @@ -241,7 +241,7 @@ void check_modes(Channel *c) return; } - for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) + for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it) { const ModeLock &ml = it->second; ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name); diff --git a/src/modules.cpp b/src/modules.cpp index 63e6bcab3..1ca060108 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -173,6 +173,9 @@ int Module::DelCommand(BotInfo *bi, Command *c) if (!bi->Commands.erase(c->name)) return MOD_ERR_NOEXIST; + + c->module = NULL; + c->service = NULL; return MOD_ERR_OK; } diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 40cd873a8..b094c8962 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -32,9 +32,9 @@ NickCore::~NickCore() /* Clean up this nick core from any users online using it * (ones that /nick but remain unidentified) */ - for (std::list<User *>::iterator it = this->Users.begin(), it_end = this->Users.end(); it != it_end; ++it) + for (std::list<User *>::iterator it = this->Users.begin(); it != this->Users.end();) { - User *user = *it; + User *user = *it++; ircdproto->SendAccountLogout(user, user->Account()); user->RemoveMode(NickServ, UMODE_REGISTERED); ircdproto->SendUnregisteredNick(user); diff --git a/src/operserv.cpp b/src/operserv.cpp index c76b34375..6437fa2c9 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -324,9 +324,8 @@ XLine *XLineManager::GetEntry(unsigned index) */ void XLineManager::Clear() { - for (std::vector<XLine *>::iterator it = this->XLines.begin(), it_end = this->XLines.end(); it != it_end; ++it) - delete *it; - this->XLines.clear(); + while (!this->XLines.empty()) + this->DelXLine(this->XLines.front()); } /** Add an entry to this XLine Manager @@ -606,7 +605,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ User *user = *it; ++it; - if (!user->HasMode(UMODE_OPER) && Anope::Match(user->realname, x->Mask)) + if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->realname, x->Mask)) kill_user(Config->ServerName, user, rreason); } } @@ -698,7 +697,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ UserContainer *uc = *it; ++it; - if (uc->user->HasMode(UMODE_OPER)) + if (uc->user->HasMode(UMODE_OPER) || uc->user->server == Me) continue; c->Kick(NULL, uc->user, "%s", reason.c_str()); } @@ -711,7 +710,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ User *user = *it; ++it; - if (!user->HasMode(UMODE_OPER) && Anope::Match(user->nick, x->Mask)) + if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->nick, x->Mask)) kill_user(Config->ServerName, user, rreason); } } diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 62dc94b3d..17c141ea7 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -579,13 +579,13 @@ void ChannelInfo::LoadMLock() */ bool ChannelInfo::HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const { - std::map<ChannelModeName, ModeLock>::const_iterator it = this->mode_locks.find(mode->Name); + std::multimap<ChannelModeName, ModeLock>::const_iterator it = this->mode_locks.find(mode->Name); if (it != this->mode_locks.end()) { if (mode->Type != MODE_REGULAR) { - std::map<ChannelModeName, ModeLock>::const_iterator it_end = this->mode_locks.upper_bound(mode->Name); + std::multimap<ChannelModeName, ModeLock>::const_iterator it_end = this->mode_locks.upper_bound(mode->Name); for (; it != it_end; ++it) { const ModeLock &ml = it->second; |