From 28dd5f0e51f6ce826acaa6a64fc9a3dc04e6efb5 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 5 Oct 2006 17:17:33 +0000 Subject: Fixed freeing of bound sockets when unloading spanningtree git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5422 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 0a04708e1..176b1c240 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3735,9 +3735,10 @@ void ReadConfiguration(bool rebind) { std::string Type = Conf->ReadValue("bind","type",j); std::string IP = Conf->ReadValue("bind","address",j); - long Port = Conf->ReadInteger("bind","port",j,true); + int Port = Conf->ReadInteger("bind","port",j,true); if (Type == "servers") { + ServerInstance->Log(DEBUG,"m_spanningtree: Binding server port %s:%d", IP.c_str(), Port); if (IP == "*") { IP = ""; @@ -3745,6 +3746,7 @@ void ReadConfiguration(bool rebind) TreeSocket* listener = new TreeSocket(ServerInstance, IP.c_str(),Port,true,10); if (listener->GetState() == I_LISTENING) { + ServerInstance->Log(DEFAULT,"m_spanningtree: Binding server port %s:%d successful!", IP.c_str(), Port); Bindings.push_back(listener); } else @@ -3753,6 +3755,7 @@ void ReadConfiguration(bool rebind) listener->Close(); DELETE(listener); } + ServerInstance->Log(DEBUG,"Done with this binding"); } } } @@ -3838,7 +3841,6 @@ void ReadConfiguration(bool rebind) class ModuleSpanningTree : public Module { - std::vector Bindings; int line; int NumServers; unsigned int max_local; @@ -4998,7 +5000,7 @@ class ModuleSpanningTree : public Module virtual ~ModuleSpanningTree() { ServerInstance->Log(DEBUG,"Performing unload of spanningtree!"); - ServerInstance->Log(DEBUG,"Freeing bindings..."); + ServerInstance->Log(DEBUG,"Freeing %d bindings...",Bindings.size()); for (unsigned int i = 0; i < Bindings.size(); i++) { ServerInstance->Log(DEBUG,"Freeing binding %d of %d",i, Bindings.size()); -- cgit v1.2.3