[asterisk-commits] mnicholson: branch 1.4 r274093 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 6 08:52:32 CDT 2010


Author: mnicholson
Date: Tue Jul  6 08:52:28 2010
New Revision: 274093

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=274093
Log:
Make get_member_status return QUEUE_NO_MEMBERS instead of QUEUE_NO_REACHABLE_MEMBERS to make joinempty=no work again.  This regression was introduced in 273639.  Also fixed whitespace.

Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=274093&r1=274092&r2=274093
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Tue Jul  6 08:52:28 2010
@@ -574,11 +574,13 @@
 	struct member *member;
 	struct ao2_iterator mem_iter;
 	enum queue_member_status result = QUEUE_NO_MEMBERS;
-	int allpaused = 1;
+	int allpaused = 1, empty = 1;
 
 	ao2_lock(q);
 	mem_iter = ao2_iterator_init(q->members, 0);
 	while ((member = ao2_iterator_next(&mem_iter))) {
+		empty = 0;
+
 		if (max_penalty && (member->penalty > max_penalty)) {
 			ao2_ref(member, -1);
 			continue;
@@ -609,9 +611,9 @@
 	ao2_iterator_destroy(&mem_iter);
 	ao2_unlock(q);
 
-    if (allpaused) {
-        result = QUEUE_NO_REACHABLE_MEMBERS;
-    }
+	if (!empty && allpaused) {
+		result = QUEUE_NO_REACHABLE_MEMBERS;
+	}
 	return result;
 }
 




More information about the asterisk-commits mailing list