diff options
author | Adam <Adam@anope.org> | 2011-04-26 19:13:51 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:08:47 -0400 |
commit | e7887c1f013248274574ab8e3167f742ccb3d69b (patch) | |
tree | f9f5959512b7129711f03156320ae0e46cabaec3 /src/main.cpp | |
parent | 076ebafa1b4cc935c466c615b94eaac415af9a67 (diff) |
Unmodularized the socket engine because its causing problems and really is unnecessary
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 53e348e69..7ec3cfe0e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,6 +100,7 @@ UplinkSocket::UplinkSocket(bool ipv6) : ConnectionSocket(ipv6) UplinkSocket::~UplinkSocket() { + SocketEngine::Process(); UplinkSock = NULL; } @@ -148,10 +149,14 @@ void do_restart_services() if (!bi->GetUID().empty()) UserListByUID.erase(bi->GetUID()); } + + FOREACH_MOD(I_OnRestart, OnRestart()); + + ModuleManager::UnloadAll(); ircdproto->SendSquit(Config->ServerName, quitmsg); - SocketEngine->Process(); delete UplinkSock; - ModuleManager::UnloadAll(); + SocketEngine::Shutdown(); + chdir(binary_dir.c_str()); my_av[0] = const_cast<char *>(("./" + services_bin).c_str()); execve(services_bin.c_str(), my_av, my_envp); @@ -160,8 +165,6 @@ void do_restart_services() throw FatalException("Restart failed"); } - FOREACH_MOD(I_OnRestart, OnRestart()); - exit(1); } @@ -200,10 +203,12 @@ static void services_shutdown() delete u; } } - SocketEngine->Process(); - delete UplinkSock; FOREACH_MOD(I_OnShutdown, OnShutdown()); ModuleManager::UnloadAll(); + ircdproto->SendSquit(Config->ServerName, quitmsg); + delete UplinkSock; + SocketEngine::Shutdown(); + /* just in case they weren't all removed at least run once */ ModuleManager::CleanupRuntimeDirectory(); } @@ -458,7 +463,7 @@ int main(int ac, char **av, char **envp) ModeManager::ProcessModes(); /* Process the socket engine */ - SocketEngine->Process(); + SocketEngine::Process(); } if (quitting) |