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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 23 13:06:52 CDT 2009


Author: mmichelson
Date: Wed Sep 23 13:06:48 2009
New Revision: 219901

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=219901
Log:
*whistle*

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=219901&r1=219900&r2=219901
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Sep 23 13:06:48 2009
@@ -895,13 +895,13 @@
 	struct ast_cc_monitor_link *new_link;
 	struct ast_cc_interface *interface = tree_item->interface;
 	struct ast_cc_interface *finder_interface = alloca(sizeof(*finder_interface) + strlen(interface->name));
-	struct ast_cc_monitor *finder = alloca(sizeof(*finder));
+	struct ast_cc_monitor finder;
 
 	strcpy(finder_interface->name, interface->name);
 	finder_interface->monitor_type = interface->monitor_type;
-	finder->interface = finder_interface;
-
-	if ((new_monitor = ao2_t_find(cc_monitors, finder, OBJ_POINTER, "Trying to find a specific monitor"))) {
+	finder.interface = finder_interface;
+
+	if ((new_monitor = ao2_t_find(cc_monitors, &finder, OBJ_POINTER, "Trying to find a specific monitor"))) {
 		ast_log(LOG_NOTICE, "Found monitor %s in tree. Re-using\n", new_monitor->interface->name);
 	} else if (!(new_monitor = cc_monitor_instance_init(interface, core_id))) {
 		return NULL;
@@ -921,7 +921,7 @@
 	ao2_t_ref(new_link->parent, +1, "Link's parent reference");
 	new_link->core_id = core_id;
 	new_link->service = tree_item->service_offered;
-	ast_atomic_fetchadd_int(new_monitor->num_requests, +1);
+	ast_atomic_fetchadd_int(&new_monitor->num_requests, +1);
 	AST_LIST_INSERT_TAIL(&parent->child_links, new_link, next_child);
 	AST_LIST_INSERT_TAIL(&new_monitor->parent_links, new_link, next_parent);
 	ast_log(LOG_NOTICE, "Created link with core_id %d, parent %s and child %s\n", new_link->core_id, new_link->parent->interface->name, new_link->child->interface->name);
@@ -982,7 +982,7 @@
 {
 	ast_log(LOG_NOTICE, "Destroying link with parent %s and child %s\n",
 			link->parent->interface->name, link->child->interface->name);
-	ast_atomic_fetchadd_int(link->child->num_requests, -1);
+	ast_atomic_fetchadd_int(&link->child->num_requests, -1);
 	ao2_t_ref(link->child, -1, "Unref link's child");
 	ao2_t_ref(link->parent, -1, "Unref link's parent");
 	ast_free(link);




More information about the asterisk-commits mailing list