FNIN(); int lpc = 0; IPC_Message *msg = NULL; gboolean hack_return_good = TRUE; crmd_client_t *curr_client = (crmd_client_t*)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; 
crmd_ipc_input_callback(IPC_Channel *client, gpointer user_data){    FNIN();    int lpc = 0;    IPC_Message *msg = NULL;    gboolean hack_return_good = TRUE;    crmd_client_t *curr_client = (crmd_client_t*)user_data;    CRM_DEBUG2("channel: %p", client);    CRM_DEBUG2("processing IPC message from %s", curr_client->table_key);    CRM_DEBUG2("Client is %s", client == NULL?"NULL":"valid");    CRM_DEBUG3("Client status %d (disconnect=%d)", client->ch_status, IPC_DISCONNECT);    while(client->ch_status != IPC_DISCONNECT && client->ops->is_message_pending(client) == TRUE)    {	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++;	char *buffer = (char*)msg->msg_body;	CRM_DEBUG2("Got xml [text=%s]", buffer);		CRM_DEBUG("crmd_ipc_input_dispatch: validating and decoding");	xmlNodePtr 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("crmd_ipc_input_dispatch: Message authorized, about to relay");		process_message(root_xml_node, TRUE, NULL);	    }	    else		CRM_DEBUG("crmd_ipc_input_dispatch: Message not authorized");	}	else	{	    cl_log(LOG_INFO, "IPC Message was not valid... discarding message.");	}	free_xml(root_xml_node);	msg->msg_done(msg);    }    CRM_DEBUG2("Processed %d messages", lpc);        CRM_DEBUG2("Client status %d", client->ch_status);    if (client->ch_status == IPC_DISCONNECT)    {	cl_log(LOG_INFO, "crmd_ipc_input_callback: received HUP from %s", curr_client->table_key);	if (curr_client != NULL)	{	    CRM_DEBUG("###-###-### Removing client from hash table");	    if (curr_client->table_key != NULL)		g_hash_table_remove(ipc_clients, curr_client->table_key);	    	    if (curr_client->sub_sys == NULL) CRM_DEBUG("Client had not registered with us yet");	    else if (strcmp(CRM_SYSTEM_LRMD, curr_client->sub_sys) == 0) have_lrmd = FALSE;	    else if (strcmp(CRM_SYSTEM_PENGINE, curr_client->sub_sys) == 0) have_te = FALSE;	    else if (strcmp(CRM_SYSTEM_TENGINE, curr_client->sub_sys) == 0) have_pe = FALSE;	    CRM_DEBUG("###-###-### Detaching crm_client");	    gboolean det = G_main_del_IPC_Channel(curr_client->client_source);	    CRM_DEBUG2("crm_client was %s detached", det?"successfully":"not");	    	    CRM_DEBUG("###-###-### Freeing crm_client");	    ha_free(curr_client);	} 	CRM_DEBUG("this client is now gone.");	FNRET(!hack_return_good);    }    	     CRM_DEBUG("crmd_ipc_input_callback: done");    FNRET(hack_return_good);}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/1527bd277bea88314ec7c1fafa964969da82ef38/crmd.c/buggy/crm/crmd/crmd.c