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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@405253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-01-09 20:25:24 +00:00
parent a4d8398013
commit d7f5a0be5d
3 changed files with 16 additions and 2 deletions

View File

@@ -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;