summaryrefslogtreecommitdiff
path: root/main/utils.c
AgeCommit message (Collapse)Author
2010-03-10Add new unit test for stringfields.Jeff Peeler
(Copied from reviewboard) Tests the following: 1. Basic allocation and setting of string fields. 2. Shrinking a string field and re-expanding it. 3. Growing the last allocation in a string field pool. 4. Setting a string to a large value such that a new string field pool must be allocated. In each part, we make sure that the string field is accurate (has the correct value in it), make sure that the 2 bytes before the string field has the correct capacity for the field, and for tests 2-4, we make sure that the string field is where we expect it to be in memory. Also tested: 5. Shrinking a string field and partially re-expanding it. 6. Setting strings in such a way as to create three separate string field pools and then removing the middle pool. There is a bug fix in the init function, which ensures the embedded_pool is set to NULL which is important for stack allocated structures. Review: https://reviewboard.asterisk.org/r/185/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26RFC compliant uri and display-name encode/decodeDavid Vossel
1. URI Encoding This patch changes ast_uri_encode()'s behavior when doreserved is enabled. Previously when doreserved was enabled only a small set of reserved characters were encoded. This set was comprised primarily of the reserved characters defined in RFC3261 section 25.1, but contained other characters as well. Rather than only escaping the reserved set, doreserved now escapes all characters not within the unreserved set as defined by RFC 3261 and RFC 2396. Also, the 'doreserved' variable has been renamed to 'do_special_char' in attempts to avoid confusion. When doreserve is not enabled, the previous logic of only encoding the characters <= 0X1F and > 0X7f remains, except for the '%' character, which must always be encoded as it signifies a HEX escaped character during the decode process. 2. URI Decoding: Break up URI before decode. In chan_sip.c ast_uri_decode is called on the entire URI instead of it's individual parts after it is parsed. This is not good as ast_uri_decode can introduce special characters back into the URI which can mess up parsing. This patch resolves this by not decoding a URI until parsing is completely done. There are many instances where we check to see if pedantic checking is enabled before we decode a URI. In these cases a new macro, SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI rather than constantly putting if (pedantic) { decode() } checks everywhere in the code. In the areas where ast_uri_decode is not dependent upon pedantic checking this macro is not used, but decoding is still moved to each individual part of the URI. The only behavior that should change from this patch is the time at which decoding occurs. Since I had to look over every place URI parsing occurs to create this patch, I found several places where we use duplicate code for parsing. To consolidate the code, those areas have updated to use the parse_uri() function where possible. 3. SIP display-name decoding according to RFC3261 section 25. To properly decode the display-name portion of a FROM header, chan_sip's get_calleridname() function required a complete re-write. More information about this change can be found in the comments at the beginning of this function. 4. Unit Tests. Unit tests for ast_uri_encode, ast_uri_decode, and get_calleridname() have been written. This involved the addition of the test_utils.c file for testing the utils api. (closes issue #16299) Reported by: wdoekes Patches: astsvn-16299-get_calleridname.diff uploaded by wdoekes (license 717) get_calleridname_rewrite.diff uploaded by dvossel (license 671) Tested by: wdoekes, dvossel, Nick_Lewis Review: https://reviewboard.asterisk.org/r/469/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15Make sure to set owner_line, ownder_func, and owner_file in ↵Mark Michelson
ast_calloc_with_stringfields. Asterisk would crash on startup if MALLOC_DEBUG were set in menuselect. This is because the manager action UpdateConfig had to resize its string field allocation to set the description. When the resize occurred, ast_copy_string would crash because we were attempting to copy a string from a NULL pointer. Setting the strings initially makes the code much less crashy. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05Fix build of utility apps that include utils.c.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05Merged revisions 237697 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r237697 | russell | 2010-01-05 11:13:28 -0600 (Tue, 05 Jan 2010) | 7 lines Change a NOTICE log message to DEBUG where it belongs. (closes issue #16479) Reported by: alexrecarey (closes SWP-577) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-07fixes incorrect logic in ast_uri_encodeDavid Vossel
issue #16299 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06Merged revisions 228378 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r228378 | mnicholson | 2009-11-06 10:26:59 -0600 (Fri, 06 Nov 2009) | 8 lines Properly handle '=' while decoding base64 messages and null terminate strings returned from BASE64_DECODE. (closes issue #15271) Reported by: chappell Patches: base64_fix.patch uploaded by chappell (license 8) Tested by: kobaz ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04Merged revisions 216435 via svnmerge from Michiel van Baak
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r216435 | mvanbaak | 2009-09-04 15:56:10 +0200 (Fri, 04 Sep 2009) | 2 lines make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Ensure that accidental calls to ast_string_field_free_memory() on embedded ↵Kevin P. Fleming
stringfield pools are safe. It is possible for a stringfield manager structure (and pool) structure to be allocated as part of a larger structure allocation (using ast_calloc_with_strinfields()); when this is done, the stringfield pool cannot be separately freed, but users of the tructure may not be aware (and shouldn't have to be aware) of whether the pool was embedded. This patch modifies the behavior so that they can always call ast_string_field_free_memory() and the function will do the right thing for both embedded and non-embedded situations. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Fix a bug in stringfields where it did not actually free the pools of memory.Joshua Colp
(closes issue #15074) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05Add a more efficient way of allocating structures that use stringfieldsKevin P. Fleming
This commit adds an API call that can be used to allocate a structure along with this stringfield storage in a single allocation. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05Correct some flaws in the memory accounting code for stringfields and ao2 ↵Kevin P. Fleming
objects Under some conditions, the memory allocation for stringfields and ao2 objects would not have supplied valid file/function names for MALLOC_DEBUG tracking, so this commit corrects that. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05Ensure that string pools allocated to hold stringfields are properly ↵Kevin P. Fleming
accounted in MALLOC_DEBUG mode This commit modifies the stringfield pool allocator to remember the 'owner' of the stringfield manager the pool is being allocated for, and ensures that pools allocated in the future when fields are populated are owned by that file/function. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23Support HTTP digest authentication for the http manager interface.Tilghman Lesher
(closes issue #10961) Reported by: ys Patches: digest_auth_r148468_v5.diff uploaded by ys (license 281) SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth Tested by: ys, twilson, tilghman Review: http://reviewboard.digium.com/r/223/ Reviewed by: tilghman,russellb,mmichelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31Optimizations to the stringfields APIKevin P. Fleming
This patch provides a number of optimizations to the stringfields API, focused around saving (not wasting) memory whenever possible. Thanks to Mark Michelson for inspiring this work and coming up with the first two optimizations that are represented here: Changes: - Cleanup of some code, fix incorrect doxygen comments - When a field is emptied or replaced with a new allocation, decrease the amount of 'active' space in the pool it was held in; if that pool reaches zero active space, and is not the current pool, then free it as it is no longer in use - When allocating a pool, try to allocate a size that will fit in a 'standard' malloc() allocation without wasting space - When allocating space for a field, store the amount of space in the two bytes immediately preceding the field; this eliminates the need to call strlen() on the field when overwriting it, and more importantly it 'remembers' the amount of space the field has available, even if a shorter string has been stored in it since it was allocated - Don't automatically double the size of each successive pool allocated; it's wasteful http://reviewboard.digium.com/r/165/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18Merged revisions 182810 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines Fix cases where the internal poll() was not being used when it needed to be. We have seen a number of problems caused by poll() not working properly on Mac OSX. If you search around, you'll find a number of references to using select() instead of poll() to work around these issues. In Asterisk, we've had poll.c which implements poll() using select() internally. However, we were still getting reports of problems. vadim investigated a bit and realized that at least on his system, even though we were compiling in poll.o, the system poll() was still being used. So, the primary purpose of this patch is to ensure that we're using the internal poll() when we want it to be used. The changes are: 1) Remove logic for when internal poll should be used from the Makefile. Instead, put it in the configure script. The logic in the configure script is the same as it was in the Makefile. Ideally, we would have a functionality test for the problem, but that's not actually possible, since we would have to be able to run an application on the _target_ system to test poll() behavior. 2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT is not defined. 3) Change uses of poll() throughout the source tree to ast_poll(). I feel that it is good practice to give the API call a new name when we are changing its behavior and not using the system version directly in all cases. So, normally, ast_poll() is just redefined to poll(). On systems where AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll(). 4) Change poll() in main/poll.c to be ast_internal_poll(). It's worth noting that any code that still uses poll() directly will work fine (if they worked fine before). So, for example, out of tree modules that are using poll() will not stop working or anything. However, for modules to work properly on Mac OSX, ast_poll() needs to be used. (closes issue #13404) Reported by: agalbraith Tested by: russell, vadim http://reviewboard.digium.com/r/198/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18Fixed error where a check for an zero length, terminated string was needed.Doug Bailey
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18Need to take into account the \0 terminator of the old string to determine ↵Doug Bailey
the amount available. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16Merged revisions 176216 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r176216 | kpfleming | 2009-02-16 15:10:38 -0600 (Mon, 16 Feb 2009) | 3 lines fix a flaw in the ast_string_field_build() family of API calls; these functions made no attempt to reuse the space already allocated to a field, so every time the field was written it would allocate new space, leading to what appeared to be a memory leak. ........ r176254 | kpfleming | 2009-02-16 15:41:46 -0600 (Mon, 16 Feb 2009) | 3 lines correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22Merged revisions 166297 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r166297 | russell | 2008-12-22 11:22:56 -0600 (Mon, 22 Dec 2008) | 2 lines Fix up timeout handling in ast_carefulwrite(). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22Introduce ast_careful_fwrite() and use in AMI to prevent partial writes.Russell Bryant
This patch introduces a function to do careful writes on a file stream which will handle timeouts and partial writes. It is currently used in AMI to address the issue that has been reported. However, there are probably a few other places where this could be used. (closes issue #13546) Reported by: srt Tested by: russell http://reviewboard.digium.com/r/104/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18Merged revisions 165796 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r165796 | russell | 2008-12-18 15:39:25 -0600 (Thu, 18 Dec 2008) | 11 lines Make ast_carefulwrite() be more careful. This patch handles some additional cases that could result in partial writes to the file description. This was done to address complaints about partial writes on AMI. (issue #13546) (more changes needed to address potential problems in 1.6) Reported by: srt Tested by: russell Review: http://reviewboard.digium.com/r/99/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16Merged revisions 164881 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r164881 | russell | 2008-12-16 15:38:29 -0600 (Tue, 16 Dec 2008) | 9 lines Fix an issue where DEBUG_THREADS may erroneously report that a thread is exiting while holding a lock. If the last lock attempt was a trylock, and it failed, it will still be in the list of locks so that it can be reported. (closes issue #13219) Reported by: pj ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15Update to work with new ast_str changes.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09Merged revisions 162413 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r162413 | russell | 2008-12-09 16:17:39 -0600 (Tue, 09 Dec 2008) | 8 lines Remove the test_for_thread_safety() function completely. The test is not valid. Besides, if we actually suspected that recursive mutexes were not working, we would get a ton of LOG_ERROR messages when DEBUG_THREADS is turned on. (inspired by a discussion on the asterisk-dev list) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29incorporates r159808 from branches/1.4:Kevin P. Fleming
------------------------------------------------------------------------ r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way ------------------------------------------------------------------------ in addition: move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19Starting with a change to ensure that ast_verbose() preserves ABI compatibilityTilghman Lesher
in 1.6.1 (as compared to 1.6.0 and versions of 1.4), this change also deprecates the use of Asterisk with FreeBSD 4, given the central use of va_copy in core functions. va_copy() is C99, anyway, and we already require C99 for other purposes, so this isn't really a big change anyway. This change also simplifies some of the core ast_str_* functions. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵Kevin P. Fleming
branch, and add the ones needed for all the new code here too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23Merged revisions 132872 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r132872 | kpfleming | 2008-07-23 06:52:18 -0500 (Wed, 23 Jul 2008) | 2 lines minor optimization for stringfields: when a field is being set to a larger value than it currently contains and it happens to be the most recent field allocated from the currentl pool, it is possible to 'grow' it without having to waste the space it is currently using (or potentially even allocate a new pool) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11Janitor patch to change uses of sizeof to ARRAY_LENBrett Bryant
(closes issue #13054) Reported by: pabelanger Patches: ARRAY_LEN.patch2 uploaded by pabelanger (license 224) Tested by: seanbright git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27Merged revisions 125793 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r125793 | tilghman | 2008-06-27 08:45:03 -0500 (Fri, 27 Jun 2008) | 2 lines In this debugging function, copy to a buffer instead of using potentially unsafe pointers. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26Merged revisions 125587 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r125587 | qwell | 2008-06-26 18:03:15 -0500 (Thu, 26 Jun 2008) | 1 line Make sure to unlock the lock_info lock (huh?). Possible deadlock? ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19Add errors that report any locks held by threads when they are being closed.Brett Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09Expand RQ_INTEGER type out to multiple types, one for each precisionTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03Add lock tracking for rwlocks. Previously, lock.h only had the ability toRussell Bryant
hold tracking information for mutexes. Now, the "core show locks" output will output information about who is holding a rwlock when a thread is waiting on it. (closes issue #11279) Reported by: ys Patches: trunk_lock_utils.v8.diff uploaded by ys (license 281) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30Fix a minor merge issue that caused a function to not get compiled in withRussell Bryant
DEBUG_THREADS like it was supposed to git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29Merged revisions 118953 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines Add some debugging code that ensures that when we do deadlock avoidance, we don't lose the information about how a lock was originally acquired. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23A new feature thanks to the fine folks at Switchvox!Mark Michelson
If a deadlock is detected, then the typical lock information will be printed along with a backtrace of the stack for the offending threads. Use of this requires compiling with DETECT_DEADLOCKS and having glibc installed. Furthermore, issuing the "core show locks" CLI command will print the normal lock information as well as a backtraces for each lock. This requires that DEBUG_THREADS is enabled and that glibc is installed. All the backtrace features may be disabled by running the configure script with --without-execinfo as an argument git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23Merged revisions 118048 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118048 | russell | 2008-05-23 07:30:53 -0500 (Fri, 23 May 2008) | 9 lines Don't declare a function that takes variable arguments as inline, because it's not valid, and on some compilers, will emit a warning. http://gcc.gnu.org/onlinedocs/gcc/Inline.html#Inline (closes issue #12289) Reported by: francesco_r Patches by Tilghman, final patch by me ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-15Use casts or intermediate variables to remove a numberLuigi Rizzo
of platform/compiler-dependent warnings when handing struct timeval fields, both reading and printing them. It is a lost battle to handle the different ways struct timeval is handled on the various platforms and compilers, so try to be pragmatic and go through int/long which are universally supported. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12Merged revisions 115735 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r115735 | mmichelson | 2008-05-12 12:51:14 -0500 (Mon, 12 May 2008) | 7 lines If a thread holds no locks, do not print any information on the thread when issuing a core show locks command. This will help to de-clutter output somewhat. Russell said it would be fine to place this improvement in the 1.4 branch, so that's why it's going here too. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01Merged revisions 115017 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r115017 | tilghman | 2008-05-01 13:59:08 -0500 (Thu, 01 May 2008) | 6 lines '#' is another reserved character for URIs that also needs to be escaped. (closes issue #10543) Reported by: blitzrage Patches: 20080418__bug10543.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22Hopefully, this will resolve the issues that russellb had with this ↵Steve Murphy
log_show_lock(). I gathered the code that filled the string, and put it in a different func which I cryptically call "append_lock_information()". Now, both log_show_lock(), and handle_show_locks() both call this code to do the work. Tested, seems to work fine. Also, log_show_lock was modified to use the ast_str stuff, along with checking for successful ast_str creation, and freeing the ast_str obj when finished. A break was inserted to terminate the search for the lock; we should never see it twice. An example usage in chan_sip.c was created as a comment, for instructional purposes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17Make this file compile. The variable str is never set anywhere. Furthermore,Russell Bryant
it duplicates a lot of code. I will leave it to murf to clean up. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16A small enhancement-- I added the routine log_show_lock to utils.c, which if ↵Steve Murphy
the mentioned lock has been acquired, this routine will log to the console the normal info about that lock you'd see from the CLI when you do a 'core show locks'. It's solely for debug-- if the lock is NOT acquired, there is no output. I use it to show 'unexpected' locks, to see where/why a lock is pre-locked. This command is to be called from points of interest, like just before a trylock, and helps to spot fleeting, highly temporal locks that normally are not locked... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10Merged revisions 114051 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines Fix 1.4 build when LOW_MEMORY is enabled. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19Merged revisions 109838 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109838 | russell | 2008-03-18 23:06:05 -0500 (Tue, 18 Mar 2008) | 2 lines Tweak spacing in a recent change because I'm very picky. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109839 65c4cc65-6c06-0410-ace0-fbb531ad65f3