MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / cib_peer_callback

Function cib_peer_callback

cib/callbacks.c:1155–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153#endif
1154
1155void
1156cib_peer_callback(xmlNode * msg, void *private_data)
1157{
1158 const char *reason = NULL;
1159 const char *originator = crm_element_value(msg, F_ORIG);
1160
1161 if (originator == NULL || crm_str_eq(originator, cib_our_uname, TRUE)) {
1162 /* message is from ourselves */
1163 int bcast_id = 0;
1164 if (!(crm_element_value_int(msg, F_CIB_LOCAL_NOTIFY_ID, &bcast_id))) {
1165 check_local_notify(bcast_id);
1166 }
1167 return;
1168
1169 } else if (crm_peer_cache == NULL) {
1170 reason = "membership not established";
1171 goto bail;
1172 }
1173
1174 if (crm_element_value(msg, F_CIB_CLIENTNAME) == NULL) {
1175 crm_xml_add(msg, F_CIB_CLIENTNAME, originator);
1176 }
1177
1178 /* crm_log_xml_trace("Peer[inbound]", msg); */
1179 cib_process_request(msg, FALSE, TRUE, TRUE, NULL);
1180 return;
1181
1182 bail:
1183 if (reason) {
1184 const char *seq = crm_element_value(msg, F_SEQ);
1185 const char *op = crm_element_value(msg, F_CIB_OPERATION);
1186
1187 crm_warn("Discarding %s message (%s) from %s: %s", op, seq, originator, reason);
1188 }
1189}
1190
1191
1192#if SUPPORT_HEARTBEAT

Callers 2

cib_ha_peer_callbackFunction · 0.85
cib_ais_dispatchFunction · 0.85

Calls 6

crm_element_valueFunction · 0.85
crm_str_eqFunction · 0.85
crm_element_value_intFunction · 0.85
check_local_notifyFunction · 0.85
crm_xml_addFunction · 0.85
cib_process_requestFunction · 0.85

Tested by

no test coverage detected