aboutsummaryrefslogtreecommitdiffstats
path: root/main/astobj2.c
AgeCommit message (Collapse)AuthorFilesLines
2009-02-12Merged revisions 175121 via svnmerge from mmichelson1-1/+10
https://origsvn.digium.com/svn/asterisk/trunk ........ r175121 | mmichelson | 2009-02-12 10:28:06 -0600 (Thu, 12 Feb 2009) | 11 lines Make lock information for ao2_trylock be more useful and gnarly Core show locks information involving an ao2_trylock did not show the function that called ao2_trylock, but would instead show ao2_trylock as the source of the lock. This is not useful when trying to debug locking issues. One bizarre note is that this logic is already in 1.4 but somehow did not get merged to trunk or the 1.6.X branches. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@175122 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05Merged revisions 161427 via svnmerge from seanbright1-1/+1
https://origsvn.digium.com/svn/asterisk/trunk ................ r161427 | seanbright | 2008-12-05 16:08:43 -0500 (Fri, 05 Dec 2008) | 22 lines Merged revisions 161426 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r161426 | seanbright | 2008-12-05 16:02:20 -0500 (Fri, 05 Dec 2008) | 15 lines Merged revisions 161421 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r161421 | seanbright | 2008-12-05 15:50:23 -0500 (Fri, 05 Dec 2008) | 8 lines Fix build errors on FreeBSD (uint -> unsigned int). (closes issue #14006) Reported by: alphaque Patches: astobj2.h-patch uploaded by alphaque (license 259) (Slightly modified by seanbright) ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@161428 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-02Merged revisions ↵tilghman1-0/+15
152969,153122,154264,154268,154366,155399,155863,156166,156295,156690,156756,158066,158082,158540,158602,159276 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r152969 | tilghman | 2008-10-30 15:35:46 -0500 (Thu, 30 Oct 2008) | 10 lines Merged revisions 152958 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r152958 | tilghman | 2008-10-30 15:33:28 -0500 (Thu, 30 Oct 2008) | 3 lines Cannot join detached threads. See http://www.opengroup.org/onlinepubs/000095399/functions/pthread_join.html (Closes issue #13400) ........ ................ r153122 | tilghman | 2008-10-31 11:35:21 -0500 (Fri, 31 Oct 2008) | 10 lines Merged revisions 153114 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r153114 | tilghman | 2008-10-31 11:30:32 -0500 (Fri, 31 Oct 2008) | 3 lines Turn off qualify on uncached realtime peers. (Closes issue #13383) ........ ................ r154264 | tilghman | 2008-11-04 12:59:48 -0600 (Tue, 04 Nov 2008) | 10 lines Recorded merge of revisions 154263 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r154263 | tilghman | 2008-11-04 12:58:05 -0600 (Tue, 04 Nov 2008) | 3 lines Make the monitor thread non-detached, so it can be joined (suggested by Russell on -dev list). ........ ................ r154268 | rmudgett | 2008-11-04 13:07:26 -0600 (Tue, 04 Nov 2008) | 11 lines Merged revisions 154266 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r154266 | rmudgett | 2008-11-04 13:01:08 -0600 (Tue, 04 Nov 2008) | 4 lines JIRA ABE-1703 mISDN sets the channel to the wrong state when it receives the indication AST_CONTROL_RINGING. ........ ................ r154366 | tilghman | 2008-11-04 14:51:18 -0600 (Tue, 04 Nov 2008) | 16 lines Merged revisions 154365 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r154365 | tilghman | 2008-11-04 14:49:33 -0600 (Tue, 04 Nov 2008) | 9 lines On busy systems, it's possible for the values checked within a single line of code to change, unless the structure is locked to ensure a consistent state. (closes issue #13717) Reported by: kowalma Patches: 20081102__bug13717.diff.txt uploaded by Corydon76 (license 14) Tested by: kowalma ........ ................ r155399 | tilghman | 2008-11-07 16:28:58 -0600 (Fri, 07 Nov 2008) | 14 lines Merged revisions 155398 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r155398 | tilghman | 2008-11-07 16:27:32 -0600 (Fri, 07 Nov 2008) | 7 lines Clarify error message. (closes issue #13809) Reported by: denke Patches: 20081104__bug13809.diff.txt uploaded by Corydon76 (license 14) Tested by: denke ........ ................ r155863 | mmichelson | 2008-11-10 15:14:44 -0600 (Mon, 10 Nov 2008) | 22 lines Merged revisions 155861 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r155861 | mmichelson | 2008-11-10 15:07:39 -0600 (Mon, 10 Nov 2008) | 14 lines Channel drivers assume that when their indicate callback is invoked, that the channel on which the callback was called is locked. This patch corrects an instance in chan_agent where a channel's indicate callback is called directly without first locking the channel. This was leading to some observed locking issues in chan_local, but considering that all channel drivers operate under the same expectations, the generic fix in chan_agent is the right way to go. AST-126 ........ ................ r156166 | russell | 2008-11-12 11:38:20 -0600 (Wed, 12 Nov 2008) | 15 lines Merged revisions 156164 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r156164 | russell | 2008-11-12 11:29:52 -0600 (Wed, 12 Nov 2008) | 7 lines Move the sanity check that makes sure "always fork" is not set along with the console option to be after the code that reads options from asterisk.conf. This resolves a situation where Asterisk can start taking up 100% when misconfigured. (Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to figure out what was causing the 100% CPU problem.) ........ ................ r156295 | tilghman | 2008-11-12 13:28:22 -0600 (Wed, 12 Nov 2008) | 13 lines Merged revisions 156294 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r156294 | tilghman | 2008-11-12 13:26:45 -0600 (Wed, 12 Nov 2008) | 6 lines If the SLA thread is not started, then reload causes a memory leak. (closes issue #13889) Reported by: eliel Patches: app_meetme.c.patch uploaded by eliel (license 64) ........ ................ r156690 | tilghman | 2008-11-13 15:30:41 -0600 (Thu, 13 Nov 2008) | 14 lines Merged revisions 156688 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r156688 | tilghman | 2008-11-13 15:24:00 -0600 (Thu, 13 Nov 2008) | 7 lines Provide more space for all the data which can appear in an originating channel name. (closes issue #13398) Reported by: bamby Patches: manager.c.diff uploaded by bamby (license 430) ........ ................ r156756 | tilghman | 2008-11-13 18:43:13 -0600 (Thu, 13 Nov 2008) | 13 lines Merged revisions 156755 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r156755 | tilghman | 2008-11-13 18:41:37 -0600 (Thu, 13 Nov 2008) | 6 lines ast_waitfordigit() requires that the channel be up, for no good logical reason. This prevents While/EndWhile from working within the "h" extension. Reported by: jgalarneau (for ABE C.2) Fixed by: me ........ ................ r158066 | mmichelson | 2008-11-20 11:39:06 -0600 (Thu, 20 Nov 2008) | 20 lines Merged revisions 158053 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158053 | mmichelson | 2008-11-20 11:33:06 -0600 (Thu, 20 Nov 2008) | 12 lines Make sure to set the hangup cause on the calling channel in the case that ast_call() fails. For incoming SIP channels, this was causing us to send a 603 instead of a 486 when the call-limit was reached on the destination channel. (closes issue #13867) Reported by: still_nsk Patches: 13867.diff uploaded by putnopvut (license 60) Tested by: blitzrage ........ ................ r158082 | mmichelson | 2008-11-20 11:54:31 -0600 (Thu, 20 Nov 2008) | 24 lines Merged revisions 158071 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158071 | mmichelson | 2008-11-20 11:48:42 -0600 (Thu, 20 Nov 2008) | 16 lines We don't handle 4XX responses to BYE well. According to section 15 of RFC 3261, we should terminate a dialog if we receive a 481 or 408 in response to our BYE. Since I am aware of at least one phone manufacturer who may sometimes send a 404 as well, I am being liberal and saying that any 4XX response to a BYE should result in a terminated dialog. (closes issue #12994) Reported by: pabelanger Patches: 12994.patch uploaded by putnopvut (license 60) Closes AST-129 ........ ................ r158540 | russell | 2008-11-21 16:12:37 -0600 (Fri, 21 Nov 2008) | 10 lines Merged revisions 158539 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158539 | russell | 2008-11-21 16:05:55 -0600 (Fri, 21 Nov 2008) | 2 lines When compiling with DEBUG_THREADS, report the real file/func/line for ao2_lock/ao2_unlock ........ ................ r158602 | tilghman | 2008-11-21 17:14:11 -0600 (Fri, 21 Nov 2008) | 12 lines Merged revisions 158600 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158600 | tilghman | 2008-11-21 17:07:46 -0600 (Fri, 21 Nov 2008) | 5 lines The passed extension may not be the same in the list as the current entry, because we strip spaces when copying the extension into the structure. Therefore, use the copied item to place the item into the list. (found by lmadsen on -dev, fixed by me) ........ ................ r159276 | tilghman | 2008-11-25 15:57:59 -0600 (Tue, 25 Nov 2008) | 14 lines Merged revisions 159269 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r159269 | tilghman | 2008-11-25 15:56:48 -0600 (Tue, 25 Nov 2008) | 7 lines Don't try to send a response on a NULL pvt. (closes issue #13919) Reported by: barthpbx Patches: chan_iax2.c.patch uploaded by eliel (license 64) Tested by: barthpbx ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@160389 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21Merged revisions 158540 via svnmerge from russell1-0/+16
https://origsvn.digium.com/svn/asterisk/trunk ................ r158540 | russell | 2008-11-21 16:12:37 -0600 (Fri, 21 Nov 2008) | 10 lines Merged revisions 158539 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158539 | russell | 2008-11-21 16:05:55 -0600 (Fri, 21 Nov 2008) | 2 lines When compiling with DEBUG_THREADS, report the real file/func/line for ao2_lock/ao2_unlock ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@158542 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-09Merged revisions 147807 via svnmerge from murf1-1/+1
https://origsvn.digium.com/svn/asterisk/trunk ........ r147807 | murf | 2008-10-09 08:17:33 -0600 (Thu, 09 Oct 2008) | 15 lines (closes issue #13557) Reported by: nickpeirson Patches: pbx.c.patch uploaded by nickpeirson (license 579) replace_bzero+bcopy.patch uploaded by nickpeirson (license 579) Tested by: nickpeirson, murf 1. replaced all refs to bzero and bcopy to memset and memmove instead. 2. added a note to the CODING-GUIDELINES 3. add two macros to asterisk.h to prevent bzero, bcopy from creeping back into the source 4. removed bzero from configure, configure.ac, autoconfig.h.in ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@147809 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-17Merged revisions 123272 via svnmerge from russell1-0/+9
https://origsvn.digium.com/svn/asterisk/trunk ................ r123272 | russell | 2008-06-17 10:52:13 -0500 (Tue, 17 Jun 2008) | 12 lines Merged revisions 123271 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r123271 | russell | 2008-06-17 10:48:31 -0500 (Tue, 17 Jun 2008) | 4 lines Fix a memory leak in astobj2 that was pointed out by seanbright. When a container got destroyed, the underlying bucket list entry for each object that was in the container at that time did not get free'd. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@123273 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-06Merged revisions 105840 via svnmerge from russell1-11/+11
https://origsvn.digium.com/svn/asterisk/trunk ........ r105840 | tilghman | 2008-03-04 17:04:29 -0600 (Tue, 04 Mar 2008) | 2 lines Whitespace changes only ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@106306 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-30Merged revisions 90348 via svnmerge from russell1-0/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90348 | russell | 2007-11-30 13:26:04 -0600 (Fri, 30 Nov 2007) | 8 lines Change the behavior of ao2_link(). Previously, in inherited a reference. Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90351 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20move internal function declarations to include/asterisk/_private.hrizzo1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89465 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-2/+2
- 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-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵qwell1-2/+2
didn't make much sense git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19Convert NEW_CLI to AST_CLI.qwell1-2/+2
Closes issue #11039, as suggested by seanbright. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-11Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)russell1-28/+52
(closes issue #10724) Reported by: eliel Patches: chan_skinny.c.patch uploaded by eliel (license 64) chan_oss.c.patch uploaded by eliel (license 64) chan_mgcp.c.patch2 uploaded by eliel (license 64) pbx_config.c.patch uploaded by seanbright (license 71) iax2-provision.c.patch uploaded by eliel (license 64) chan_gtalk.c.patch uploaded by eliel (license 64) pbx_ael.c.patch uploaded by seanbright (license 71) file.c.patch uploaded by seanbright (license 71) image.c.patch uploaded by seanbright (license 71) cli.c.patch uploaded by moy (license 222) astobj2.c.patch uploaded by moy (license 222) asterisk.c.patch uploaded by moy (license 222) res_limit.c.patch uploaded by seanbright (license 71) res_convert.c.patch uploaded by seanbright (license 71) res_crypto.c.patch uploaded by seanbright (license 71) app_osplookup.c.patch uploaded by seanbright (license 71) app_rpt.c.patch uploaded by seanbright (license 71) app_mixmonitor.c.patch uploaded by seanbright (license 71) channel.c.patch uploaded by seanbright (license 71) translate.c.patch uploaded by seanbright (license 71) udptl.c.patch uploaded by seanbright (license 71) threadstorage.c.patch uploaded by seanbright (license 71) db.c.patch uploaded by seanbright (license 71) cdr.c.patch uploaded by moy (license 222) pbd_dundi.c.patch uploaded by moy (license 222) app_osplookup-rev83558.patch uploaded by moy (license 222) res_clioriginate.c.patch uploaded by moy (license 222) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85460 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-13Merged revisions 82339 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82339 | russell | 2007-09-13 13:57:08 -0500 (Thu, 13 Sep 2007) | 1 line resolve a warning when not building under dev mode ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82341 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-13Merged revisions 82337 via svnmerge from russell1-5/+33
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82337 | russell | 2007-09-13 13:45:59 -0500 (Thu, 13 Sep 2007) | 4 lines Only compile in tracking astobj2 statistics if dev-mode is enabled. Also, when dev mode is enabled, register the CLI command that can be used to run the astobj2 test and print out statistics. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82338 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10Changes applied from marta's team/marta/astobj2 branch to solve a race conditionmurf1-2/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82124 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-06various changes to the documentation, and redefinition ofrizzo1-15/+6
ao2_hash_fn and ao2_callback_fn typedefs, in preparation to more cleanup of the _search_flags Please do not merge this change to 1.4 yet - there are no functional changes anyways. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81712 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-04Merged revisions 81448 via svnmerge from russell1-15/+15
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81448 | russell | 2007-09-04 13:37:44 -0500 (Tue, 04 Sep 2007) | 4 lines Remove the typedefs on ao2_container and ao2_iterator. This is simply because we don't typedef objects anywhere else in Asterisk, so we might as well make this follow the same convention. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81449 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-01Merged revisions 81426 via svnmerge from mmichelson1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81426 | mmichelson | 2007-09-01 01:02:06 -0500 (Sat, 01 Sep 2007) | 4 lines Making match_by_addr into ao2_match_by_addr and making it available everywhere since it could be a handy callback to have ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81427 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Merged revisions 80424 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80424 | russell | 2007-08-22 17:40:27 -0500 (Wed, 22 Aug 2007) | 10 lines When converting this code to use the list macros, I changed it so objects are added to the head of a bucket instead of the tail. However, while looking over code with mmichelson, we noticed that the algorithm used in ao2_iterator_next requires that items are added to the tail. This wouldn't have caused any huge problem, but it wasn't correct. It meant that if an object was added to a container while you were iterating it, and it was added to the same bucket that the current element is in, then the new object would be returned by ao2_iterator_next, and any other objects in the bucket would be bypassed in the traversal. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80425 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Merged revisions 80362 via svnmerge from russell1-0/+685
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80362 | russell | 2007-08-22 15:21:36 -0500 (Wed, 22 Aug 2007) | 34 lines Merge changes from team/russell/iax_refcount. This set of changes fixes problems with the handling of iax2_user and iax2_peer objects. It was very possible for a thread to still hold a reference to one of these objects while a reload operation tries to delete them. The fix here is to ensure that all references to these objects are tracked so that they can't go away while still in use. To accomplish this, I used the astobj2 reference counted object model. This code has been in one of Luigi Rizzo's branches for a long time and was primarily developed by one of his students, Marta Carbone. I wanted to go ahead and bring this in to 1.4 because there are other problems similar to the ones fixed by these changes, so we might as well go ahead and use the new astobj if we're going to go through all of the work necessary to fix the problems. As a nice side benefit of these changes, peer and user handling got more efficient. Using astobj2 lets us not hold the container lock for peers or users nearly as long while iterating. Also, by changing a define at the top of chan_iax2.c, the objects will be distributed in a hash table, drastically increasing lookup speed in these containers, which will have a very big impact on systems that have a large number of users or peers. The use of the hash table will be made the default in trunk. It is not the default in 1.4 because it changes the behavior slightly. Previously, since peers and users were stored in memory in the same order they were specified in the configuration file, you could influence peer and user matching order based on the order they are specified in the configuration. The hash table does not guarantee any order in the container, so this behavior will be going away. It just means that you have to be a little more careful ensuring that peers and users are matched explicitly and not forcing chan_iax2 to have to guess which user is the right one based on secret, host, and access list settings, instead of simply using the username. If you have any questions, feel free to ask on the asterisk-dev list. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80387 f38db490-d61c-443f-a65b-d21fe96a405b