Rebind server sockets on REHASH, closes bug #478

git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8664 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2008-01-08 15:34:06 +00:00
parent 0632fe2505
commit b3e7819f5c
3 changed files with 10 additions and 2 deletions

View File

@ -1147,7 +1147,7 @@ void ModuleSpanningTree::OnRehash(userrec* user, const std::string &parameter)
ServerInstance->RehashServer();
}
}
Utils->ReadConfiguration(false);
Utils->ReadConfiguration(true);
InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
}

View File

@ -349,7 +349,7 @@ bool TreeSocket::RemoteRehash(const std::string &prefix, std::deque<std::string>
{
this->Instance->SNO->WriteToSnoMask('l',"Remote rehash initiated by \002"+prefix+"\002.");
this->Instance->RehashServer();
Utils->ReadConfiguration(false);
Utils->ReadConfiguration(true);
InitializeDisabledCommands(Instance->Config->DisabledCommands, Instance);
}
Utils->DoOneToAllButSender(prefix,"REHASH",params,prefix);

View File

@ -454,6 +454,14 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
ConfigReader* Conf = new ConfigReader(ServerInstance);
if (rebind)
{
for (unsigned int i = 0; i < Bindings.size(); i++)
{
ServerInstance->SE->DelFd(Bindings[i]);
Bindings[i]->Close();
}
ServerInstance->InspSocketCull();
Bindings.clear();
for (int j = 0; j < Conf->Enumerate("bind"); j++)
{
std::string Type = Conf->ReadValue("bind","type",j);