[asterisk-commits] twilson: branch 1.8 r342380 - /branches/1.8/apps/app_queue.c

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


Author: twilson
Date: Tue Oct 25 14:52:16 2011
New Revision: 342380

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

Modified:
    branches/1.8/apps/app_queue.c

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