aboutsummaryrefslogtreecommitdiffstats
path: root/include/modules.h
Commit message (Expand)AuthorAgeFilesLines
* Tidy up module loading code•••The existing code had several defects: - Core module file names were hardcoded, while autoloaded non- core module filenames were not. Code that loaded core modules had a different but in some places duplicated structure to the code that loaded autoloaded modules. - Module loading for autoloaded modules happened in dentry order, making it unpredictable from one server to the next, or even across instances of `make install` on the same server. - Module loading for autoloaded modules did not verify that the dentry was a file before trying to load it. - An IRCd start (or a conftest) only printed lines about loading modules mentioned in the configuration file. - The configuration file was parsed before loading core and autoloaded modules, meaning any modules specified in the configuration file would be loaded first. - Once a module was loaded, it was added to the head of the module list, making MODLIST show them in reverse loaded order (newest (re)loaded modules at the top of the list). These are addressed as follows: - We now scan the core and autoload module directories and use this to determine which modules to load. - We now sort the dentries according to their filename before iterating them to load them, making module load order finally deterministic. - We now test if a dentry is actually a file before trying to load it. - We now print a message to the console (if running in foreground or conftest mode) when loading any module, including core and autoloaded modules. - The message printed to the console now has the IRCd module directory prefix stripped from it if it matches. - The configuration file is now parsed after loading core and autoload modules. - The modules are added to the module list in the order that they are loaded. This now makes MODLIST show the order that modules were (re)loaded in. Modifications to two modules are part of this effort: - The autoload module `m_alias` relied upon the alias dict not being NULL when loaded, but this is only the case after the configuration file has been parsed. The module already had a "rehash" hook to destroy all existing aliases and create new ones, so we can just make the module do nothing on load (remove its modinit function) and change it to use the "conf_read_end" hook instead of the "rehash" hook, and it will still create aliases after the configuration file is subsequently parsed. With this modification, there are now no in-tree consumers of the "rehash" hook. - The autoload module `m_services` iterated `service_list` upon loading it, which will now be empty (a no-op) since the module is loaded before configuration file is parsed. This module too handles the configuration file being parsed with a "conf_read_end" hook and takes the appropriate action, so we can just remove this code from its modinit function. All other modules' modinit functions have been audited for behaviour like this; there was nothing of note. Gravatar Aaron Jones2026-03-221-3/+0
* Adjust unsigned int -> uint64_t for all caps•••The previous commit addressed the issue with (most) function signatures, but forgot to update the caps themselves to be 64-bit. This fixes that, and finishes the remaining overlooked function signatures. Gravatar Ryan Schmidt2026-03-171-1/+1
* Innovation by sedGravatar Ed Kellett2020-10-151-3/+3
* Merge pull request #329 from edk0/reload-by-path•••Reload modules by pathGravatar Aaron Jones2020-06-251-0/+1
|\
| * Reload modules by pathGravatar Ed Kellett2020-06-021-0/+1
* | Implement hook prioritiesGravatar Ed Kellett2020-05-011-1/+1
|/
* m_modules: make modreload work like restart•••/modrestart used to be implemented as a normal command and could crash when used remotely because it would reload m_encap, which was on the call stack at the time. This was fixed in 41390bfe5f. However, /modreload has exactly the same problem, so I'm giving it the same treatment. Incidentally: This bug was first discovered in ircd-seven, where the `/mod*` commands themselves live in the core, so m_encap was the only way the crash could happen (and it didn't most of the time, because m_encap would only be moved if you got unlucky). But `/mod*` are in modules in charybdis, so /modrestart would have unloaded the code it was in the middle of executing. With that in mind, I'm not sure how it ever appeared to work. Gravatar Ed Kellett2019-11-171-0/+7
* Deferred capability notifications from modules•••Reloading modules sends CAP DEL followed by an immediate CAP NEW: :staberinde.local CAP * DEL :account-tag :staberinde.local CAP * NEW :account-tag This isn't very nice. /modrestart is particularly bad. In order to avoid doing this, we remember the capability set at the beginning of module operations, compare that with the set afterwards, and report only the differences with CAP {DEL,NEW}. Gravatar Ed Kellett2019-09-071-0/+4
* modules: serious cleanupsGravatar William Pitcock2016-06-181-5/+4
* modules: cleanupsGravatar William Pitcock2016-06-181-1/+1
* modules: move module loading/unloading commands to dedicated module.•••There's no reason to really have these in the main ircd anymore, static modules are dead and aren't coming back. To ensure people don't do something hopelessly retarded, this is a core module. Gravatar Elizabeth Myers2016-04-071-0/+5
* bool-ify modules stuffGravatar Elizabeth Myers2016-04-031-7/+7
* config.h delenda estGravatar Elizabeth Myers2016-03-191-1/+1
* Move module description headers to the top•••This is cleaner. Note this was broken out of a much larger piece of work I did, so if there's any problems, I apologise! Gravatar Elizabeth Myers2016-03-091-1/+1
* Add ircd serials to AV2.Gravatar Elizabeth Myers2016-03-071-1/+3
* modules: AV2: use unsigned int for capability IDs instead of signed intGravatar William Pitcock2016-03-071-1/+1
* modules: tag origin at load time.Gravatar Elizabeth Myers2016-03-061-8/+6
* modules: add origin field to V2Gravatar Elizabeth Myers2016-03-061-2/+9
* modules: add description fieldGravatar Elizabeth Myers2016-03-061-0/+1
* modules: whoops, forgot one tiny thingGravatar Elizabeth Myers2016-03-061-1/+1
* modules: add new MAPI V2•••MAPI V1 is still supported for legacy modules, but it is highly recommended to update to MAPI V2. It includes support for capability tables, module descriptions, and implicit versions. Gravatar Elizabeth Myers2016-03-061-15/+43
* Remove $Id tags from everything.•••These are obsolete and none have changed since 10 years gao... Gravatar Elizabeth Myers2016-03-061-2/+0
* general: remove last vestiges of static modules support (this hasn't ever act...Gravatar William Pitcock2016-01-061-7/+1
* modules: use libltdl to load the modulesGravatar William Pitcock2016-01-051-7/+2
* Simplify module path list, removing strcpy use.Gravatar Jilles Tjoelker2014-02-231-5/+0
* Prefer PATH_MAX to non-standard MAXPATHLEN.Gravatar Jilles Tjoelker2011-10-281-1/+1
* Remove irc_basename, replace it with rb_basename from libratbox.Gravatar Valeriy Yatsko2008-12-031-1/+0
* libcharybdis includes gone.Gravatar Valery Yatsko2008-04-021-1/+0
* [svn] - the new plan:••• + branches/release-2.1 -> 2.2 base + 3.0 -> branches/cxxconversion + backport some immediate 3.0 functionality for 2.2 + other stuff Gravatar nenolod2007-01-241-0/+123