mirror of
https://github.com/anope/anope.git
synced 2026-07-10 12:23:14 +02:00
BUILD : 1.7.12 (917) BUGS : NOTES : Fixed module loading code to get rid of a few memory leaks and to (hopefully) correctly remove runtime copies when loading fails
git-svn-id: svn://svn.anope.org/anope/trunk@917 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@663 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
60d4067370
commit
08f523a239
@@ -4,6 +4,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005
|
||||
10/01 A Information on uplink server can be displayed via OperServ STATS. [ #00]
|
||||
09/29 A Configuration option to change fantasy command prefix character. [ #00]
|
||||
09/28 A Event for fantasy commands triggered without channel access. [ #00]
|
||||
10/25 F Memleaks and not removing tempfiles on failed module loading. [ #00]
|
||||
10/25 F Help response for os random news was using opernews text. [ #00]
|
||||
10/05 F Changed NickLen and BSFantasyChar into recommended and optional. [ #00]
|
||||
10/04 F Added missing hs_request to win32 modules makefile. [ #00]
|
||||
|
||||
+38
-20
@@ -72,7 +72,9 @@ void modules_init(void)
|
||||
{
|
||||
#ifdef USE_MODULES
|
||||
int idx;
|
||||
int ret;
|
||||
Module *m;
|
||||
|
||||
for (idx = 0; idx < ModulesNumber; idx++) {
|
||||
m = findModule(ModulesAutoload[idx]);
|
||||
if (!m) {
|
||||
@@ -80,7 +82,10 @@ void modules_init(void)
|
||||
mod_current_module = m;
|
||||
mod_current_user = NULL;
|
||||
alog("trying to load [%s]", mod_current_module->name);
|
||||
alog("status: [%d]", loadModule(mod_current_module, NULL));
|
||||
ret = loadModule(mod_current_module, NULL);
|
||||
alog("status: [%d]", ret);
|
||||
if (ret != MOD_ERR_OK)
|
||||
destroyModule(m);
|
||||
mod_current_module = NULL;
|
||||
mod_current_user = NULL;
|
||||
}
|
||||
@@ -109,6 +114,8 @@ void modules_core_init(int number, char **list)
|
||||
alog("debug: trying to load core module [%s]",
|
||||
mod_current_module->name);
|
||||
alog("debug: status: [%d]", status);
|
||||
if (status != MOD_ERR_OK)
|
||||
destroyModule(mod_current_module);
|
||||
}
|
||||
mod_current_module = NULL;
|
||||
mod_current_user = NULL;
|
||||
@@ -133,26 +140,30 @@ int protocol_module_init(void)
|
||||
alog("status: [%d]", ret);
|
||||
mod_current_module = NULL;
|
||||
|
||||
/* This is really NOT the correct place to do config checks, but
|
||||
* as we only have the ircd struct filled here, we have to over
|
||||
* here. -GD
|
||||
*/
|
||||
if (UseTokens && !(ircd->token)) {
|
||||
alog("Anope does not support TOKENS for this ircd setting; unsetting UseToken");
|
||||
UseTokens = 0;
|
||||
}
|
||||
|
||||
if (UseTS6 && !(ircd->ts6)) {
|
||||
alog("Chosen IRCd does not support TS6, unsetting UseTS6");
|
||||
UseTS6 = 0;
|
||||
if (ret == MOD_ERR_OK) {
|
||||
/* This is really NOT the correct place to do config checks, but
|
||||
* as we only have the ircd struct filled here, we have to over
|
||||
* here. -GD
|
||||
*/
|
||||
if (UseTokens && !(ircd->token)) {
|
||||
alog("Anope does not support TOKENS for this ircd setting; unsetting UseToken");
|
||||
UseTokens = 0;
|
||||
}
|
||||
|
||||
if (UseTS6 && !(ircd->ts6)) {
|
||||
alog("Chosen IRCd does not support TS6, unsetting UseTS6");
|
||||
UseTS6 = 0;
|
||||
}
|
||||
|
||||
/* We can assume the ircd supports TS6 here */
|
||||
if (UseTS6 && !Numeric) {
|
||||
alog("UseTS6 requires the setting of Numeric to be enabled.");
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
destroyModule(m);
|
||||
}
|
||||
|
||||
/* We can assume the ircd supports TS6 here */
|
||||
if (UseTS6 && !Numeric) {
|
||||
alog("UseTS6 requires the setting of Numeric to be enabled.");
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -165,7 +176,9 @@ void modules_delayed_init(void)
|
||||
{
|
||||
#ifdef USE_MODULES
|
||||
int idx;
|
||||
int ret;
|
||||
Module *m;
|
||||
|
||||
for (idx = 0; idx < ModulesDelayedNumber; idx++) {
|
||||
m = findModule(ModulesDelayedAutoload[idx]);
|
||||
if (!m) {
|
||||
@@ -173,9 +186,12 @@ void modules_delayed_init(void)
|
||||
mod_current_module = m;
|
||||
mod_current_user = NULL;
|
||||
alog("trying to load [%s]", mod_current_module->name);
|
||||
alog("status: [%d]", loadModule(mod_current_module, NULL));
|
||||
ret = loadModule(mod_current_module, NULL);
|
||||
alog("status: [%d]", ret);
|
||||
mod_current_module = NULL;
|
||||
mod_current_user = NULL;
|
||||
if (ret != MOD_ERR_OK)
|
||||
destroyModule(m);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2660,6 +2676,8 @@ void handleModuleOperationQueue(void)
|
||||
alog("Trying to load module [%s]", mod_operation_queue->m->name);
|
||||
status = loadModule(mod_operation_queue->m, mod_operation_queue->u);
|
||||
alog("Module loading status: %d", status);
|
||||
if (status != MOD_ERR_OK)
|
||||
destroyModule(mod_operation_queue->m);
|
||||
} else if (mod_operation_queue->op == MOD_OP_UNLOAD) {
|
||||
alog("Trying to unload module [%s]", mod_operation_queue->m->name);
|
||||
status = unloadModule(mod_operation_queue->m, mod_operation_queue->u);
|
||||
|
||||
+5
-1
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="12"
|
||||
VERSION_EXTRA="-rc1"
|
||||
VERSION_BUILD="915"
|
||||
VERSION_BUILD="917"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.12 (917)
|
||||
# BUGS :
|
||||
# NOTES : Fixed module loading code to get rid of a few memory leaks and to (hopefully) correctly remove runtime copies when loading fails
|
||||
#
|
||||
# BUILD : 1.7.12 (915)
|
||||
# BUGS :
|
||||
# NOTES : Fixed indenting errors in last commit (1.7.12-rc1)
|
||||
|
||||
Reference in New Issue
Block a user