aboutsummaryrefslogtreecommitdiffstats
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2008-03-18Merged revisions 109447 via svnmerge from russell4-11/+14
https://origsvn.digium.com/svn/asterisk/trunk ........ r109447 | twilson | 2008-03-18 10:43:34 -0500 (Tue, 18 Mar 2008) | 3 lines Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not actual problems, per se. I also added format attributes to any printf wrapper functions I found that didn't have them. -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@109459 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-11Merged revisions 107373 via svnmerge from kpfleming1-2/+2
https://origsvn.digium.com/svn/asterisk/trunk ................ r107373 | kpfleming | 2008-03-11 06:36:51 -0500 (Tue, 11 Mar 2008) | 19 lines Merged revisions 107352 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r107352 | kpfleming | 2008-03-11 06:04:29 -0500 (Tue, 11 Mar 2008) | 11 lines fix up various compiler warnings found with gcc-4.3: - the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function) - main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement - main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur - main/editline/readline.c had an unused variable ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@107374 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07Merged revisions 106553 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/trunk ................ r106553 | tilghman | 2008-03-07 00:54:47 -0600 (Fri, 07 Mar 2008) | 14 lines Merged revisions 106552 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines Safely use the strncat() function. (closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@106554 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-28Merged revisions 105116 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r105116 | russell | 2008-02-28 16:23:05 -0600 (Thu, 28 Feb 2008) | 8 lines Fix a bug in the lock tracking code that was discovered by mmichelson. The issue is that if the lock history array was full, then the functions to mark a lock as acquired or not would adjust the stats for whatever lock is at the end of the array, which may not be itself. So, do a sanity check to make sure that we're updating lock info for the proper lock. (This explains the bizarre stats on lock #63 in BE-396, thanks Mark!) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105144 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27open(2) needs a mode argument when O_CREAT is specified.tilghman1-1/+1
(Closes issue #12083) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104534 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-21Ignore some more unused generated events.tilghman1-1/+10
(closes issue #12042) Reported by: junky Patches: astman_events.diff uploaded by junky (license 177) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104014 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-15Remove extraneous copytilghman1-2/+0
(closes issue #12002) Reported by: junky Patches: conf2ael.diff uploaded by junky (license 177) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103716 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-04Merged revisions 102323 via svnmerge from tilghman1-1/+7
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r102323 | tilghman | 2008-02-04 15:06:09 -0600 (Mon, 04 Feb 2008) | 7 lines Cross-platform fix: OS X now deprecates the use of the daemon(3) API. (closes issue #11908) Reported by: oej Patches: 20080204__bug11908.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102329 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10The fixes in this commit are mainly to allow compiling of trunk with ↵murf1-1/+1
--enable-dev-mode, mutex profiling, lock debugging, etc. Mainly, the version.c needs to be in the OBJS line; asterisk.h was chosen to have the prototypes for ast_get_version, ast_get_version_num; and the ASTERISK_FILE_VERSION macro needs to be used after including asterisk.h in a few files. I hope I did the right thing. If not, let me know. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97656 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-08Make ast_atomic_fetchadd_int_slow magically appear in extconf.file1-3/+8
(closes issue #11703) Reported by: dmartin git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97041 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-20modify http://svn.digium.com/view/asterisk?view=rev&rev=93603rizzo3-14/+12
so that paths and filename are writable by asterisk.c without causing segfaults. This involves defining the variables as const char *, and having them point to as static, writable buffer defined in asterisk.c On passing, fix some errors in using these variables in some files in utils/ , and in res/snmp/agent.c which was redefining a variable without using paths.h (not applicable to 1.4) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94168 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18Add a canary process, for high priority mode (asterisk -p) to ensure that iftilghman2-1/+85
Asterisk goes into a busy loop, the machine will be recoverable. We'd still need to do a restart to put Asterisk back into high priority mode, but at least a reboot won't be required. (Closes issue #11559) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93804 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18make configuration variable const so they are not accidentallyrizzo3-9/+9
modified. This requires casting the strings in asterisk.c when writing to them, so we do it through a macro to do it consistently. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93603 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18remove unnecessary (char *) casts for ast_config_AST_* variables.rizzo1-1/+1
There are some left in the .flex files, left to the maintainer... git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93582 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10Add ast_atomic_fetchadd_int_slow to check_expr for platforms that need it.file1-0/+8
(closes issue #11484) Reported by: snuffy git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92206 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10remove relative paths and use ASTTOPDIR instead.rizzo1-25/+26
Give a default value to ASTTOPDIR if unset so we can at least do a 'make clean' without too much trouble. The proper fix, however, is to partition the top level Makefile in a 'setup' and a 'main' part, in a way that the 'setup' part can be included from subdirs' Makefiles and allow targets to be built without going through the top level Makefile. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92104 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10simplify this filerizzo1-6/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92103 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-09add hashtab.c to the list of files deletedrizzo1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92042 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-09normalize subdirs' Makefile by using ASTTOPDIR and not .. to referencerizzo1-1/+1
the top level directory. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92022 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-08normalize header order, and add a comment on the needrizzo1-2/+10
to clean up this file. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91930 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-04Fix the build of astman. Any file that includes any asterisk sub-headersrussell1-1/+3
needs to first include asterisk.h. (closes issue #11394) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91029 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29let's try this again... *all* compilation and linking in Asterisk should be ↵kpfleming2-19/+13
done using the standard compilation rules, not manually created ones. changing hashtest.c to use these rules caused the compiler to notice a large number of coding guidelines violations, so those are fixed too. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90150 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26closes issue #11341; made changes to make utils again right with the ↵murf3-1/+7
MTX_PROFILE world. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89595 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21enable support for stack backtrace for stuff built in utils/rizzo1-0/+2
(this was present in the main tree but forgotten here). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89506 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21move these forward declarations back to asterisk.h where they belong... even ↵kpfleming2-36/+14
though asterisk.h includes compat.h, these declarations have nothing to do with the being platform-compatible and are directly related to being part of Asterisk git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89482 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21more header removal/normalizationrizzo3-30/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89473 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19move the declaration of struct ast_channel ast_frame and ast_modulerizzo1-2/+0
to compat.h so it is always available - hopefully this will let us reduce the number of inclusions of channel.h and frame.h git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89426 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17more cygwin/mingw32 compatibility fixesrizzo2-1/+9
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89373 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17add a return NULL to a function that is expected to return a valuerizzo1-0/+1
so compilers that don't understand that this code is NOTREACHED will not complain (the fault is not much on the compiler but on the declaration of pthread_exit on certain platforms) s/certain platform/cygwin/ if you are really curious git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89368 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17more removal of duplicate #include linesrizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89349 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16remove redundant #include "asterisk/compat.h",rizzo1-7/+1
but make sure that asterisk/compiler.h is included everywhere git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89336 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo3-23/+0
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: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12Don't forget the ASTERISK_VERSION for the sake of the mtx_prof stuff.murf1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89201 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12(closes issue #11221)kpfleming2-14/+2
Reported by: eliel Patches: utils.Makefile.patch uploaded by eliel (modified by me) (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89190 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12Fix building on FreeBSD by including/not including some headers.file1-0/+2
(closes issue #11218) Reported by: ys Patches: trunk89169.diff uploaded by ys (license 281) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89177 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-09This is the perhaps the biggest, boldest, most daring change I've ever ↵murf2-3/+398
committed to trunk. Forgive me in advance any disruption this may cause, and please, report any problems via the bugtracker. The upside is that this can speed up large dialplans by 20 times (or more). Context, extension, and priority matching are all fairly constant-time searches. I introduce here my hashtables (hashtabs), and a regression for them. I would have used the ast_obj2 tables, but mine are resizeable, and don't need the object destruction capability. The hashtab stuff is well tested and stable. I introduce a data structure, a trie, for extension pattern matching, in which knowledge of all patterns is accumulated, and all matches can be found via a single traversal of the tree. This is per-context. The trie is formed on the first lookup attempt, and stored in the context for future lookups. Destruction routines are in place for hashtabs and the pattern match trie. You can see the contents of the pattern match trie by using the 'dialplan show' cli command when 'core set debug' has been done to put it in debug mode. The pattern tree traversal only traverses those parts of the tree that are interesting. It uses a scoreboard sort of approach to find the best match. The speed of the traversal is more a function of the length of the pattern than the number of patterns in the tree. The tree also contains the CID matching patterns. See the source code comments for details on how everything works. I believe the approach general enough that any issues that might come up involving fine points in the pattern matching algorithm, can be solved by just tweaking things. We shall see. The current pattern matcher is fairly involved, and replicating every nuance of it is difficult. If you find and report problems, I will try to resolve than as quickly as I can. The trie and hashtabs are added to the existing context and exten structs, and none of the old machinery has been removed for the sake of the multitude of functions that use them. In the future, we can (maybe) weed out the linked lists and save some space. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89129 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-2/+3
- 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: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-05Move AUDIO_LIBS outside the top level Makefile. This too is used onlyrizzo1-0/+4
in one place. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88770 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02Add pbx_lua as a method of doing extensionstilghman1-0/+81
Reported by: mnicholson Patch by: mnicholson Closes issue #11140 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88250 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01This commits the performance mods that give the priority processing engine ↵murf1-0/+4
in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88166 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01Remove another copied source file on "make clean".russell1-1/+1
(closes issue #11137) Reported by: IgorG Patches: addonclean-87971-1.patch uploaded by IgorG (license 20) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88062 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29UGH... while trying to fix #10995, I found all kinds of cruft in this ↵kpfleming2-39/+22
Makefile. It should all be gone now, and as a side effect hashtest2 now builds with --enable-dev-mode enabled without a host of errors git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87498 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29clean up assembler and preprocessor files if they are here tookpfleming1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87467 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26Merged revisions 87168 via svnmerge from murf2-0/+23
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config, ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87187 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17and then, I noticed the clicompat stuff.murf3-37/+10
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17more stub routines to allow linkage in stand-alone environment, with thread ↵murf1-0/+15
debugs turned on git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86181 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17more stub routines to allow linkage in stand-alone environment, with thread ↵murf1-0/+16
debugs turned on git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86180 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-09Remove redundant includes (patch by snuffy) (Closes issue #10922)tilghman2-3/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85140 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08Fix up tree so that it compiles when MTX Profiling is enabled.file3-0/+11
(closes issue #10898) Reported by: snuffy Patches: 10898-mtx_prof.diff uploaded by qwell (license 4) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85025 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01OK. THis a DEBUG_THREADS situation.murf1-1/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84331 f38db490-d61c-443f-a65b-d21fe96a405b