[asterisk-commits] mmichelson: branch group/CCSS r222689 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 7 15:35:28 CDT 2009


Author: mmichelson
Date: Wed Oct  7 15:35:24 2009
New Revision: 222689

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=222689
Log:
Address some XXX comments by doing what they say!


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=222689&r1=222688&r2=222689
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Oct  7 15:35:24 2009
@@ -2006,15 +2006,22 @@
 		}
 		ast_assert(link_iter->child != NULL);
 		ast_assert(link_iter->child->callbacks != NULL);
-		link_iter->child->callbacks->request_cc(link_iter->child, core_id, link_iter);
-		/* XXX Should check the return value and potentially prune
-		 * out monitors that return unsuccessfully since they were
-		 * not able to properly request CC
+		if (link_iter->child->callbacks->request_cc(link_iter->child, core_id, link_iter)) {
+			prune_links(link_iter->child, core_id, link_iter);
+		}
+	}
+	if (AST_LIST_EMPTY(&monitor->child_links)) {
+		/* None of the child monitors successfully requested
+		 * CC, and so all of the child links were pruned. If this
+		 * is an extension monitor, just return -1. If this is the
+		 * root monitor, then that means failure all around, so request
+		 * a state change to CC_FAILED
 		 */
-	}
-	/* XXX If ALL child monitors are unsuccessful, we should probably
-	 * return -1 to whoever called this
-	 */
+		if (monitor->interface->monitor_class == AST_CC_ROOT_MONITOR) {
+			ast_cc_request_state_change(CC_FAILED, core_id, "All monitors failed to request CC");
+		}
+		return -1;
+	}
 	return 0;
 }
 




More information about the asterisk-commits mailing list