ha_msg_del(relay_message); 
crm_msg_del(relay_message); 
relay_message(HA_Message *relay_message, gboolean originated_locally){	int is_for_dc	= 0;	int is_for_dcib	= 0;	int is_for_crm	= 0;	int is_for_cib	= 0;	int is_local    = 0;	gboolean processing_complete = FALSE;	const char *host_to = cl_get_string(relay_message, F_CRM_HOST_TO);	const char *sys_to  = cl_get_string(relay_message, F_CRM_SYS_TO);	const char *type    = cl_get_string(relay_message, F_TYPE);	const char *msg_error = NULL;	crm_debug("Routing message %s",		  cl_get_string(relay_message, XML_ATTR_REFERENCE));	if(relay_message == NULL) {		msg_error = "Cannot route empty message";	} else if(safe_str_eq(CRM_OP_HELLO,			      cl_get_string(relay_message, F_CRM_TASK))){		/* quietly ignore */		processing_complete = TRUE;	} else if(safe_str_neq(type, T_CRM)) {		msg_error = "Bad message type";	} else if(sys_to == NULL) {		msg_error = "Bad message destination: no subsystem";	}	if(msg_error != NULL) {		processing_complete = TRUE;		crm_err("%s", msg_error);		crm_log_message(LOG_ERR, relay_message);	}	if(processing_complete) {		ha_msg_del(relay_message);		return TRUE;	}		processing_complete = TRUE;		is_for_dc   = (strcmp(CRM_SYSTEM_DC,   sys_to) == 0);	is_for_dcib = (strcmp(CRM_SYSTEM_DCIB, sys_to) == 0);	is_for_cib  = (strcmp(CRM_SYSTEM_CIB,  sys_to) == 0);	is_for_crm  = (strcmp(CRM_SYSTEM_CRMD, sys_to) == 0);			is_local = 0;	if(host_to == NULL || strlen(host_to) == 0) {		if(is_for_dc) {			is_local = 0;						} else if(is_for_crm && originated_locally) {			is_local = 0;						} else {			is_local = 1;		}				} else if(strcmp(fsa_our_uname, host_to) == 0) {		is_local=1;	}	crm_trace("is_local    %d", is_local);	crm_trace("is_for_dcib %d", is_for_dcib);	crm_trace("is_for_dc   %d", is_for_dc);	crm_trace("is_for_crm  %d", is_for_crm);	crm_trace("AM_I_DC     %d", AM_I_DC);	crm_trace("sys_to      %s", crm_str(sys_to));	crm_trace("host_to     %s", crm_str(host_to));			if(is_for_dc || is_for_dcib) {		if(AM_I_DC) {			ROUTER_RESULT("Message result: DC/CRMd process");			processing_complete = FALSE; /* more to be done by caller */						} else if(originated_locally) {			ROUTER_RESULT("Message result: External relay to DC");			send_msg_via_ha(fsa_cluster_conn, relay_message);						} else {			/* discard */			ROUTER_RESULT("Message result: Discard, not DC");			ha_msg_del(relay_message);		}				} else if(is_local && (is_for_crm || is_for_cib)) {		ROUTER_RESULT("Message result: CRMd process");		processing_complete = FALSE; /* more to be done by caller */				} else if(is_local) {		ROUTER_RESULT("Message result: Local relay");		send_msg_via_ipc(relay_message, sys_to);				} else {		ROUTER_RESULT("Message result: External relay");		send_msg_via_ha(fsa_cluster_conn, relay_message);	}		return processing_complete;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/7fb8e97a799c74feeee6cc3103b226aa70b9dbf4/messages.c/buggy/crm/crmd/messages.c