[asterisk-commits] twilson: branch 10 r342381 - in /branches/10: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 25 14:53:17 CDT 2011


Author: twilson
Date: Tue Oct 25 14:53:13 2011
New Revision: 342381

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=342381
Log:
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

Modified:
    branches/10/   (props changed)
    branches/10/apps/app_queue.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_queue.c?view=diff&rev=342381&r1=342380&r2=342381
==============================================================================
--- branches/10/apps/app_queue.c (original)
+++ branches/10/apps/app_queue.c Tue Oct 25 14:53:13 2011
@@ -6801,9 +6801,12 @@
 
 	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)




More information about the asterisk-commits mailing list