1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 03:46:36 +02:00

Made Anope able to process normally when disconnected from the uplink and not sleep(), enable usage of non-blocking connect() and default all sockets to non blocking mode. Some cleanup to m_ssl and some cleanup to main.cpp.

This commit is contained in:
Adam
2011-05-21 04:57:27 -04:00
parent 7e5727288d
commit 115f94bfc2
30 changed files with 547 additions and 469 deletions
+5 -3
View File
@@ -308,6 +308,8 @@ ModuleReturn ModuleManager::DeleteModule(Module *m)
ano_module_t handle = m->handle;
Anope::string filename = m->filename;
Log(LOG_DEBUG) << "Unloading module " << m->name;
ano_modclearerr();
void (*destroy_func)(Module *m) = function_cast<void (*)(Module *)>(dlsym(m->handle, "AnopeFini"));
const char *err = ano_moderr();
@@ -471,14 +473,14 @@ void ModuleManager::ClearCallBacks(Module *m)
delete m->CallBacks.front();
}
/** Unloading all modules, NEVER call this when Anope isn't shutting down.
* Ever.
/** Unloading all modules except the protocol module.
*/
void ModuleManager::UnloadAll()
{
std::vector<Anope::string> modules[MT_END];
for (std::list<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; ++it)
modules[(*it)->type].push_back((*it)->name);
if ((*it)->type != PROTOCOL)
modules[(*it)->type].push_back((*it)->name);
for (size_t i = MT_BEGIN + 1; i != MT_END; ++i)
for (unsigned j = 0; j < modules[i].size(); ++j)