diff options
author | Terry Wilson <twilson@digium.com> | 2011-10-25 19:54:17 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2011-10-25 19:54:17 +0000 |
commit | 5749ef5be87eaaa38208a31f8e486d4ae9127eb3 (patch) | |
tree | c9c3878f8aebbf8044dc78e20efbbeb6d5d2cb12 | |
parent | 3551bfcbbc55855df83da83346ff19371ce63f6b (diff) |
Properly update membercount for reloaded members
Since q->membercount is set to 0 before reloading, it is important
to increment it again for reloaded members as well as added.
(closes issue AST-676)
Review: https://reviewboard.asterisk.org/r/1541/
........
Merged revisions 342380 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 342381 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_queue.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 440702599..d8b8399c8 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -6869,9 +6869,12 @@ static void reload_single_member(const char *memberdata, struct call_queue *q) if (cur) { ao2_ref(cur, -1); - } else { - q->membercount++; } + + /* Since this function is only called in a loop parsing all members after setting + * q->membercount = 0 if we are reloading, we must increment the membercount whether + * we add or reload, otherwise q->membercount stays 0 after a reload */ + q->membercount++; } static int mark_member_dead(void *obj, void *arg, int flags) |