]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Allow support for multiple dns results per request. This is a significant change...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index 9675a6ac8588f35dbf2ca71a1d1c41de0a3a1713..1c54c5a687d7606d47b6b57a3a1acc9a3d277b79 100644 (file)
@@ -190,7 +190,6 @@ SpanningTreeUtilities::~SpanningTreeUtilities()
        {
                ServerInstance->SE->DelFd(Bindings[i]);
                Bindings[i]->Close();
-               DELETE(Bindings[i]);
        }
        while (TreeRoot->ChildCount())
        {
@@ -200,10 +199,10 @@ SpanningTreeUtilities::~SpanningTreeUtilities()
                        TreeSocket* sock = child_server->GetSocket();
                        ServerInstance->SE->DelFd(sock);
                        sock->Close();
-                       DELETE(sock);
                }
        }
        delete TreeRoot;
+       ServerInstance->InspSocketCull();
 }
 
 void SpanningTreeUtilities::AddThisServer(TreeServer* server, TreeServerList &list)
@@ -486,7 +485,6 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
                                        {
                                                ServerInstance->Log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port: %s:%d: %s",IP.c_str(), portno, strerror(errno));
                                                listener->Close();
-                                               DELETE(listener);
                                        }
                                }
                        }
@@ -500,8 +498,12 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
        ChallengeResponse = !Conf->ReadFlag("options", "disablehmac", 0);
        quiet_bursts = Conf->ReadFlag("options", "quietbursts", 0);
        PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
+       PingFreq = Conf->ReadInteger("options", "serverpingfreq", 0, true);
 
-       if (PingWarnTime < 0 || PingWarnTime > 59)
+       if (PingFreq == 0)
+               PingFreq = 60;
+
+       if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)
                PingWarnTime = 0;
 
        LinkBlocks.clear();