]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree.cpp
TimeSyncTimer now uses repeat timer.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree.cpp
index cbecfa24f1bf117cdab3ac52048793e4521268c8..df302a7bff221a9a5d8ef0d74b4b1a91fedd8bb1 100644 (file)
@@ -3719,7 +3719,7 @@ class ServernameResolver : public Resolver
                /* Nothing in here, folks */
        }
 
-       void OnLookupComplete(const std::string &result, unsigned int ttl)
+       void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
        {
                /* Initiate the connection, now that we have an IP to use.
                 * Passing a hostname directly to InspSocket causes it to
@@ -3768,7 +3768,7 @@ class SecurityIPResolver : public Resolver
        {
        }
 
-       void OnLookupComplete(const std::string &result, unsigned int ttl)
+       void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
        {
                ServerInstance->Log(DEBUG,"Security IP cache: Adding IP address '%s' for Link '%s'",result.c_str(),MyLink.Name.c_str());
                Utils->ValidIPs.push_back(result);
@@ -4124,10 +4124,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
                                        {
                                                bool cached;
                                                SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L.IPAddr, L, cached);
-                                               if (!cached)
-                                                       ServerInstance->AddResolver(sr);
-                                               else
-                                                       delete sr;
+                                               ServerInstance->AddResolver(sr, cached);
                                        }
                                        catch (ModuleException& e)
                                        {
@@ -4659,10 +4656,7 @@ class ModuleSpanningTree : public Module
                        {
                                bool cached;
                                ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, ServerInstance,x->IPAddr, *x, cached);
-                               if (!cached)
-                                       ServerInstance->AddResolver(snr);
-                               else
-                                       delete snr;
+                               ServerInstance->AddResolver(snr, cached);
                        }
                        catch (ModuleException& e)
                        {
@@ -5164,6 +5158,7 @@ class ModuleSpanningTree : public Module
                        }
                }
                Utils->ReadConfiguration(false);
+               InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
        }
 
        // note: the protocol does not allow direct umode +o except
@@ -5465,15 +5460,13 @@ class ModuleSpanningTree : public Module
        }
 };
 
-TimeSyncTimer::TimeSyncTimer(InspIRCd *Inst, ModuleSpanningTree *Mod) : InspTimer(43200, Inst->Time()), Instance(Inst), Module(Mod)
+TimeSyncTimer::TimeSyncTimer(InspIRCd *Inst, ModuleSpanningTree *Mod) : InspTimer(43200, Inst->Time(), true), Instance(Inst), Module(Mod)
 {
 }
 
 void TimeSyncTimer::Tick(time_t TIME)
 {
        Module->BroadcastTimeSync();
-       Module->SyncTimer = new TimeSyncTimer(Instance, Module);
-       Instance->Timers->AddTimer(Module->SyncTimer);
 }
 
 void SpanningTreeUtilities::DoFailOver(Link* x)