cib_peer_callback(const struct ha_msg* msg, void* private_data){	int is_done      = 1;	int call_type    = 0;	int call_options = 0;	enum cib_errors rc = cib_ok;	struct ha_msg *op_reply = NULL;		const char *originator = cl_get_string(msg, F_ORIG);	const char *reply_to   = cl_get_string(msg, F_CIB_ISREPLY);	const char *client_id = NULL;	if(cib_get_operation_id(msg, &call_type) != cib_ok) {		crm_err("Invalid operation... discarding msg");		return;	}	if(cib_server_ops[call_type].modifies_cib	   || (reply_to == NULL && cib_is_master)) {		is_done = 0;	}	crm_info("Processing message from peer...");	cl_log_message(msg);		if(reply_to == NULL && cib_is_master == FALSE) {		/* this is for the master instance and we're not it */		crm_debug("Ignoring msg for master instance");		return;			} else if(is_done == 0) {		crm_debug("Processing msg for result");		rc = cib_process_command(msg, &op_reply, TRUE);	} else if(safe_str_eq(reply_to, cib_our_uname)) {		crm_debug("Nothing for us to do..."			 " just send reply back to the client");	} else {		crm_warn("Nothing for us to do?");	}	if(op_reply == NULL) {		crm_trace("copy original message");		op_reply = ha_msg_copy(msg);	}	if(reply_to == NULL) {		crm_trace("add the originator to message");		ha_msg_add(op_reply, F_CIB_ISREPLY, originator);	}		ha_msg_value_int(msg, F_CIB_CALLOPTS, &call_options);	crm_trace("Retrieved call options: %d", call_options);		if(safe_str_eq(reply_to, cib_our_uname)) {		/* send callback to originator */		cib_client_t *client_obj = NULL;		crm_trace("find the client");		client_id  = cl_get_string(msg, F_CIB_CLIENTID);		if(client_id != NULL) {			client_obj = g_hash_table_lookup(				client_list, client_id);		} else {			crm_err("No client to sent the responce to."				"  F_CIB_CLIENTID not set.");		}				crm_debug("Sending callback to originator of delegated request");		if(client_obj != NULL) {			if(is_done == 0) {				crm_debug("Sending local modify response");			} else {				crm_debug("Sending master response");			}			if(call_options & cib_sync_call) {				crm_debug("Sending sync response: %d", call_options);				msg2ipcchan(op_reply, client_obj->channel);							} else {				crm_debug("Sending async response");				send_via_callback_channel(					op_reply, client_obj->callback_id);			}					} else {			crm_warn("Client %s may have left us", client_id);		}			} else if(reply_to != NULL && safe_str_eq(reply_to, cib_our_uname)) {		/* nothing more to do...		 * this was a non-originating slave update		 */		crm_debug("Completed non-originating slave update");		/* from now on we are the server */ 	} else if(rc == cib_ok		  && cib_server_ops[call_type].modifies_cib		  && !(call_options & cib_scope_local)) {		/* this (successful) call modified the CIB _and_ the		 * change needs to be broadcast...		 *   send via HA to other nodes		 */		crm_debug("Sending update request to everyone");		hb_conn->llc_ops->sendclustermsg(hb_conn, op_reply);	} else {		/* send reply via HA to originating node */		crm_debug("Sending request result to originator only");		hb_conn->llc_ops->send_ordered_nodemsg(			hb_conn, op_reply, originator);	}	return;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/d39f681224438bbcdcdea6e8279818e73151eb06/callbacks.c/buggy/crm/cib/callbacks.c