summaryrefslogtreecommitdiff
path: root/main/astobj2.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-01-09 20:34:19 +0000
committerKinsey Moore <kmoore@digium.com>2014-01-09 20:34:19 +0000
commit51901aa2ed0a177ad7a2bca3e22be3c8d39bde25 (patch)
tree78c220ec8f9ef31c9b2c35b375b4db8b85178a74 /main/astobj2.c
parentbce38c0cc59a3388ef15d0de3e41508be946aa5f (diff)
astobj2: Correct ao2_iterator opacity violations
This corrects the ao2_iterator opacity violations in res_pjsip_session.c by adding a global function to get the number of elements inside the container hidden behind the iterator. (closes issue ASTERISK-23053) Review: https://reviewboard.asterisk.org/r/3111/ Reported by: Richard Mudgett ........ Merged revisions 405253 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 614e17096..ec80f6489 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -1682,6 +1682,11 @@ void *__ao2_iterator_next(struct ao2_iterator *iter)
return internal_ao2_iterator_next(iter, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__);
}
+int ao2_iterator_count(struct ao2_iterator *iter)
+{
+ return ao2_container_count(iter->c);
+}
+
static void container_destruct(void *_c)
{
struct ao2_container *c = _c;