CRM_DEBUG2("crm_client was %s detached",
CRM_DEBUG("crm_client was %s detached",
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;	xmlNodePtr root_xml_node;	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_DEBUG3("Processing xml from %s [text=%s]",			   curr_client->table_key, buffer);			root_xml_node =			find_xml_in_ipcmessage(msg, FALSE);		if (root_xml_node != NULL) {			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);				msg = NULL;		buffer = NULL;		root_xml_node = NULL;	}	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) {			struct crm_subsystem_s *the_subsystem = 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) 				the_subsystem = pe_subsystem;			else if (strcmp(CRM_SYSTEM_TENGINE, curr_client->sub_sys) == 0)				the_subsystem = te_subsystem;			else if (strcmp(CRM_SYSTEM_CIB, curr_client->sub_sys) == 0)				the_subsystem = cib_subsystem;			if(the_subsystem != NULL) {				cleanup_subsystem(the_subsystem);			} // else that was a transient client						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");			}						cl_free(curr_client->table_key);			cl_free(curr_client->sub_sys);			cl_free(curr_client->uuid);			cl_free(curr_client);		}		CRM_DEBUG("this client has now left the building.");		FNRET(!hack_return_good);	}    	FNRET(hack_return_good);}