]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Amend OnPostCommand to specify whether the command is loopcalled.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index 79dc24e6a0ccb7bab55347285f948219cbbaa5e0..cde627e21af47aa26b4be649d911a307b71f1e21 100644 (file)
@@ -33,7 +33,7 @@ SpanningTreeUtilities* Utils = NULL;
 
 ModResult ModuleSpanningTree::OnAcceptConnection(int newsock, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
 {
-       if (from->bind_tag->getString("type") != "servers")
+       if (!stdalgo::string::equalsci(from->bind_tag->getString("type"), "servers"))
                return MOD_RES_PASSTHRU;
 
        std::string incomingip = client->addr();
@@ -118,7 +118,7 @@ CullResult SpanningTreeUtilities::cull()
                sock->Close();
        }
 
-       for(std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = timeoutlist.begin(); i != timeoutlist.end(); ++i)
+       for(TimeoutList::iterator i = timeoutlist.begin(); i != timeoutlist.end(); ++i)
        {
                TreeSocket* s = i->first;
                s->Close();
@@ -229,13 +229,10 @@ void SpanningTreeUtilities::ReadConfiguration()
        AnnounceTSChange = options->getBool("announcets");
        AllowOptCommon = options->getBool("allowmismatch");
        quiet_bursts = ServerInstance->Config->ConfValue("performance")->getBool("quietbursts");
-       PingWarnTime = options->getDuration("pingwarning");
-       PingFreq = options->getDuration("serverpingfreq");
+       PingWarnTime = options->getDuration("pingwarning", 15);
+       PingFreq = options->getDuration("serverpingfreq", 60, 1);
 
-       if (PingFreq == 0)
-               PingFreq = 60;
-
-       if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)
+       if (PingWarnTime >= PingFreq)
                PingWarnTime = 0;
 
        AutoconnectBlocks.clear();
@@ -253,7 +250,7 @@ void SpanningTreeUtilities::ReadConfiguration()
                        L->AllowMasks.push_back(s);
 
                L->IPAddr = tag->getString("ipaddr");
-               L->Port = tag->getInt("port");
+               L->Port = tag->getUInt("port", 0);
                L->SendPass = tag->getString("sendpass", tag->getString("password"));
                L->RecvPass = tag->getString("recvpass", tag->getString("password"));
                L->Fingerprint = tag->getString("fingerprint");