} else if (strcmp(CRM_SYSTEM_TENGINE, curr_client->sub_sys) == 0) { te_subsystem->ipc = NULL; clear_bit_inplace(&fsa_input_register, R_TE_CONNECTED);   } else if (strcmp(CRM_SYSTEM_CIB, curr_client->sub_sys) == 0) { cib_subsystem->ipc = NULL; clear_bit_inplace(&fsa_input_register, R_CIB_CONNECTED);  }  
if(the_subsystem != NULL) { cleanup_subsystem(the_subsystem); }  
crmd_ipc_input_callback(IPC_Channel *client, gpointer user_data){	int lpc = 0;	char *buffer = NULL;	IPC_Message *msg = NULL;	gboolean hack_return_good = TRUE;	crmd_client_t *curr_client = (crmd_client_t*)user_data;	FNIN();	CRM_DEBUG2("processing IPC message from %s",		   curr_client->table_key);	while(client->ops->is_message_pending(client)) {		if (client->ch_status == IPC_DISCONNECT) {			/* The message which was pending for us is that			 * the IPC status is now IPC_DISCONNECT */			break;		}		if (client->ops->recv(client, &msg) != IPC_OK) {			perror("Receive failure:");			FNRET(!hack_return_good);		}		if (msg == NULL) {			CRM_DEBUG("No message this time");			continue;		}		lpc++;		buffer = (char*)msg->msg_body;		CRM_DEBUG2("Got xml [text=%s]", buffer);			xmlNodePtr root_xml_node =			find_xml_in_ipcmessage(msg, FALSE);		if (root_xml_node != NULL) {#ifdef MSG_LOG		char *msg_text = dump_xml(root_xml_node);	if(msg_in_strm == NULL) {		msg_in_strm = fopen("/tmp/inbound.log", "w");	}	fprintf(msg_in_strm, "[IPC (%s)]\t%s\n",		xmlGetProp(root_xml_node, XML_ATTR_REFERENCE),		msg_text);	fflush(msg_in_strm);	ha_free(msg_text);	#endif			if (crmd_authorize_message(root_xml_node,						   msg,						   curr_client)) {				CRM_DEBUG("Message authorized,about to relay");				s_crmd_fsa(C_IPC_MESSAGE,					   I_ROUTER,					   root_xml_node);							} else {				CRM_DEBUG("Message not authorized");			}		} else {			cl_log(LOG_INFO,			       "IPC Message was not valid... discarding.");		}		free_xml(root_xml_node);		msg->msg_done(msg);	}	CRM_DEBUG2("Processed %d messages", lpc);    	if (client->ch_status == IPC_DISCONNECT)	{		cl_log(LOG_INFO,		       "received HUP from %s",		       curr_client->table_key);		if (curr_client != NULL) {						if (curr_client->sub_sys == NULL)				CRM_DEBUG("Client had not registered with us yet");			else if (strcmp(CRM_SYSTEM_PENGINE,					curr_client->sub_sys) == 0) {				pe_subsystem->ipc = NULL;				clear_bit_inplace(&fsa_input_register,						  R_PE_CONNECTED);			} else if (strcmp(CRM_SYSTEM_TENGINE,					curr_client->sub_sys) == 0) {				te_subsystem->ipc = NULL;				clear_bit_inplace(&fsa_input_register,						  R_TE_CONNECTED);			} else if (strcmp(CRM_SYSTEM_CIB,					curr_client->sub_sys) == 0) {				cib_subsystem->ipc = NULL;				clear_bit_inplace(&fsa_input_register,						  R_CIB_CONNECTED);							}					if (curr_client->table_key != NULL) {				/*				 * Key is destroyed below: curr_client->table_key				 * Value is cleaned up by G_main_del_IPC_Channel				 */				g_hash_table_remove(					ipc_clients,					curr_client->table_key);			}			if(curr_client->client_source != NULL) {				gboolean det =					G_main_del_IPC_Channel(curr_client->client_source);							CRM_DEBUG2("crm_client was %s detached",					   det?"successfully":"not");			}						ha_free(curr_client->table_key);			ha_free(curr_client->sub_sys);			ha_free(curr_client->uid);			ha_free(curr_client);		}		CRM_DEBUG("this client has now left the building.");		FNRET(!hack_return_good);	}    	FNRET(hack_return_good);}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/92568d01105daa81bdbbfc75a44a6f567577403e/messages.c/buggy/crm/crmd/messages.c