Skip to content

Commit

Permalink
Rebind server sockets on REHASH, closes bug #478
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8664 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
rburchell committed Jan 8, 2008
1 parent 0632fe2 commit b3e7819
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/m_spanningtree/main.cpp
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/m_spanningtree/treesocket2.cpp
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/modules/m_spanningtree/utils.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit b3e7819

Please sign in to comment.