summaryrefslogtreecommitdiff
path: root/main/loader.c
AgeCommit message (Collapse)Author
2007-11-20switch compile-time option checking to string storage mode in this branch tooKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17define RTLD_LOCAL for platforms that don't have it.Luigi Rizzo
This is only to complete the build, clearly the linker behaviour will be completely different and likely to cause trouble in those cases. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Merged revisions 89325 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89325 | kpfleming | 2007-11-16 10:47:46 -0600 (Fri, 16 Nov 2007) | 4 lines To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash. If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08improve linked-list macros in two ways:Kevin P. Fleming
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07remove a debugging message which i forgot in.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Fix embedding of modules on FreeBSD:Luigi Rizzo
the constructor for the list of modules was run after the constructors for the embedded modules (which appended entries to the list). As a result, the list appeared empty when it was time to use it. On linux the order of execution of constructor was evidently different (it may depend on the ordering of modules in the ELF file). This is only a workaround - there may be other situations where the execution of constructors causes problems, so if we manage to find a more general solution this workaround can go away. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22merging patches that don't compile is bad... mmkay?Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Merged revisions 86630 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86630 | file | 2007-10-22 10:33:23 -0300 (Mon, 22 Oct 2007) | 6 lines Fixes for building under OpenSolaris. (closes issue #11047) Reported by: snuffy Patches: 11047-fixes.diff uploaded by snuffy (license 35) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16Don't reload a configuration file if nothing has changed.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Do a massive conversion for using the ast_verb() macroRussell Bryant
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19After some study, thought, comparing, etc. I've backed out the previous ↵Steve Murphy
universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵Tilghman Lesher
microsecond, instead of only to the second git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17via 10206, I have added an option (e) to Dial to allow the h exten to get ↵Steve Murphy
run on peer. Had to upgrade ast_flag stuff to 64 bits to do this. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24Conversions to ast_debug()Russell Bryant
(issue #9984, patches from eliel and dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Convert uses of strdup() to ast_strdup()Russell Bryant
(issue #9983, eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵Tilghman Lesher
guidelines changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05Merged revisions 67308 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r67308 | russell | 2007-06-05 10:51:53 -0500 (Tue, 05 Jun 2007) | 5 lines When shutting down "gracefully", go through and run the unload() callbacks for all of the modules. "stop now" is considered a non-graceful shutdown and will not go through this process. (issue #9804, reported by chrisost, patch by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07ConstificationsOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03Merged revisions 62986 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r62986 | kpfleming | 2007-05-03 11:38:56 -0500 (Thu, 03 May 2007) | 2 lines improve loader a bit, by avoiding trying to initialize embedded modules twice and avoiding trying to load modules from disk when they have been loaded already during the 'preload' pass (reported by blitzrage on IRC, patch by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20Merged revisions 61705 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r61705 | qwell | 2007-04-20 16:15:29 -0500 (Fri, 20 Apr 2007) | 12 lines Merged revisions 61704 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r61704 | qwell | 2007-04-20 16:14:27 -0500 (Fri, 20 Apr 2007) | 4 lines Fix an issue that I noticed while looking over issue 9571. The reload timestamp was getting set after reloading the built-in stuff, and before the modules. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-19It is possible for mod to become invalid after we unload it (if it's a ↵Joshua Colp
dynamic module) so move it around a bit. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07Make the loader less noisy under valgrind.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22give embedded modules a helping hand by backing up and restoring their ↵Kevin P. Fleming
global variables when they are loaded and unloaded git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08Merged revisions 53532 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r53532 | tilghman | 2007-02-08 07:47:54 -0600 (Thu, 08 Feb 2007) | 2 lines Issue 9007 - Mutex not released on early return ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31Take two, using find_resource on Kevin's suggestion. Olle Johansson
Might need better locking support, giving up if we can't get the lock. Right now, using existing locking in find_resource git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30Adding dialplan function IFMODULE, so you can create dialplans that handleOlle Johansson
various PBX installations and checks if a module is loaded before using it. example IFMODULE(chan_sip3.so) issue #6671 in the bug tracker, finally gone. Thanks to mithraen for keeping it updated. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21Merged revisions 45817 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45817 | file | 2006-10-21 14:48:58 -0400 (Sat, 21 Oct 2006) | 2 lines Don't use promotion on Darwin because it doesn't seem to work quite right in all cases, this should solve the unresolved symbol issue people have been seeing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04Merged revisions 44322 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r44322 | kpfleming | 2006-10-03 19:25:44 -0500 (Tue, 03 Oct 2006) | 3 lines ensure that local include files are always used avoid a duplicate function name (term_init()) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03bug #8076 check option_debug before printing to debug channel.Matt O'Gorman
patch provided in bugnote, with minor changes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-15reveting modifaction to __ast_module_user_removeAnthony LaMantia
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-13Tweak changes that went in on revision 42891Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-13small fix for 7944Anthony LaMantia
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-26ensure that unload_dynamic_module won't continue dereferencing a module ↵Kevin P. Fleming
pointer after the module has been unloaded from memory git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-25instead of reverting this supposedly 'stupid' change, let's try to get it ↵Kevin P. Fleming
working properly also eliminate a warning from dlopen() because some flags were missing on the second dlopen() call git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-24Revert stupid RTLD_NOLOAD change that breaks module loading on some systems.Matthew Fredrickson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-23use RTLD_NOLOAD if it's available to make loading dynamic modules a little ↵Kevin P. Fleming
faster and less resource-intensive also, keep trying to dlclose() a module until it actually goes away, since it may have other modules it brought in when it was loaded (thanks PCadach for pointing this problem out to me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22generate a message when a module cannot be found and loadable modules are ↵Kevin P. Fleming
disabled git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22minor improvementsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22when loadable modules are disabled, if someone tries to load a module that ↵Kevin P. Fleming
does not exist, don't dereference a NULL pointer, just stop trying to load it... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21restore 'preload' functionality in loaderKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21restore printing of module name during loadingKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21use a safer process for checking if a module wants to export symbols into ↵Kevin P. Fleming
the global namespace git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21don't declare these variables unless neededKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3