[asterisk-commits] mjordan: branch mjordan/12-corosync r413033 - in /team/mjordan/12-corosync: m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Apr 26 21:34:25 CDT 2014


Author: mjordan
Date: Sat Apr 26 21:34:18 2014
New Revision: 413033

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413033
Log:
Fix MWI PLTYPE error; remove some debug messages/cleanup

Modified:
    team/mjordan/12-corosync/main/app.c
    team/mjordan/12-corosync/res/res_corosync.c

Modified: team/mjordan/12-corosync/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-corosync/main/app.c?view=diff&rev=413033&r1=413032&r2=413033
==============================================================================
--- team/mjordan/12-corosync/main/app.c (original)
+++ team/mjordan/12-corosync/main/app.c Sat Apr 26 21:34:18 2014
@@ -122,7 +122,7 @@
 				AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
 				AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, mwi_state->new_msgs,
 				AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, mwi_state->old_msgs,
-				AST_EVENT_IE_EID, AST_EVENT_IE_EID, mwi_state->eid, sizeof(mwi_state->eid),
+				AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, mwi_state->eid, sizeof(mwi_state->eid),
 				AST_EVENT_IE_END);
 
 	return event;

Modified: team/mjordan/12-corosync/res/res_corosync.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-corosync/res/res_corosync.c?view=diff&rev=413033&r1=413032&r2=413033
==============================================================================
--- team/mjordan/12-corosync/res/res_corosync.c (original)
+++ team/mjordan/12-corosync/res/res_corosync.c Sat Apr 26 21:34:18 2014
@@ -314,7 +314,6 @@
 	}
 
 	ast_rwlock_rdlock(&event_types_lock);
-	ast_log(AST_LOG_NOTICE, "GOT EVENT TYPE %d\n", event_type);
 	publish_handler = event_types[event_type].publish_to_stasis;
 	if (!event_types[event_type].subscribe ||
 		!publish_handler) {
@@ -353,20 +352,20 @@
 		return;
 	}
 
-	if (ast_event_get_type(event) == AST_EVENT_PING) {
-		const struct ast_eid *eid;
-		char buf[128] = "";
-
-		eid = ast_event_get_ie_raw(event, AST_EVENT_IE_EID);
-		ast_eid_to_str(buf, sizeof(buf), (struct ast_eid *) eid);
-		ast_log(LOG_NOTICE, "(ast_event_cb) Got event PING from server with EID: '%s'\n", buf);
-	}
-
 	if (ast_eid_cmp(&ast_eid_default,
 			ast_event_get_ie_raw(event, AST_EVENT_IE_EID))) {
 		/* If the event didn't originate from this server, don't send it back out. */
 		ast_free(event);
 		return;
+	}
+
+	if (ast_event_get_type(event) == AST_EVENT_PING) {
+		const struct ast_eid *eid;
+		char buf[128] = "";
+
+		eid = ast_event_get_ie_raw(event, AST_EVENT_IE_EID);
+		ast_eid_to_str(buf, sizeof(buf), (struct ast_eid *) eid);
+		ast_log(LOG_NOTICE, "(publish_to_corosync) Sending event PING from this server with EID: '%s'\n", buf);
 	}
 
 	iov.iov_base = (void *)event;
@@ -758,6 +757,7 @@
 									  NULL);
 		} else if (!event_types[i].publish && event_types[i].sub && event_types[i].topic_fn) {
 			event_types[i].sub = stasis_forward_cancel(event_types[i].sub);
+			event_types[i].sub = NULL;
 			stasis_message_router_remove(stasis_router,
 										 event_types[i].message_type_fn());
 		}
@@ -883,7 +883,7 @@
 
 	if ((cs_err = corosync_cfg_initialize(&cfg_handle, &cfg_callbacks)) != CS_OK) {
 		ast_log(LOG_ERROR, "Failed to initialize cfg: (%d)\n", (int) cs_err);
-		return AST_MODULE_LOAD_DECLINE;
+		goto failed;
 	}
 
 	if ((cs_err = cpg_initialize(&cpg_handle, &cpg_callbacks)) != CS_OK) {




More information about the asterisk-commits mailing list