]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Properly update membercount for reloaded members
authorTerry Wilson <twilson@digium.com>
Tue, 25 Oct 2011 19:53:13 +0000 (19:53 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 25 Oct 2011 19:53:13 +0000 (19:53 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342381 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 2ffbc84d9664bcebea726b7e7831b4d2ded9637c..1654989281611e648bf32e6c3a6cbee78ec4a885 100644 (file)
@@ -6801,9 +6801,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)