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

Function attrd_ais_dispatch

tools/attrd.c:360–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359#if SUPPORT_COROSYNC
360static gboolean
361attrd_ais_dispatch(int kind, const char *from, const char *data)
362{
363 xmlNode *xml = NULL;
364
365 if (kind == crm_class_cluster) {
366 xml = string2xml(data);
367 if (xml == NULL) {
368 crm_err("Bad message received: '%.120s'", data);
369 }
370 }
371
372 if (xml != NULL) {
373 attr_hash_entry_t *hash_entry = NULL;
374 const char *op = crm_element_value(xml, F_ATTRD_TASK);
375 const char *host = crm_element_value(xml, F_ATTRD_HOST);
376 const char *ignore = crm_element_value(xml, F_ATTRD_IGNORE_LOCALLY);
377
378 /* crm_xml_add_int(xml, F_SEQ, wrapper->id); */
379 crm_xml_add(xml, F_ORIG, from);
380
381 if (host != NULL && safe_str_eq(host, attrd_uname)) {
382 crm_notice("Update relayed from %s", from);
383 attrd_local_callback(xml);
384
385 } else if (ignore == NULL || safe_str_neq(from, attrd_uname)) {
386 crm_trace("%s message from %s", op, from);
387 hash_entry = find_hash_entry(xml);
388 stop_attrd_timer(hash_entry);
389 attrd_perform_update(hash_entry);
390 }
391
392 free_xml(xml);
393 }
394
395 return TRUE;
396}
397
398static void
399attrd_ais_destroy(gpointer unused)

Callers

nothing calls this directly

Calls 9

string2xmlFunction · 0.85
crm_element_valueFunction · 0.85
crm_xml_addFunction · 0.85
attrd_local_callbackFunction · 0.85
safe_str_neqFunction · 0.85
find_hash_entryFunction · 0.85
stop_attrd_timerFunction · 0.85
attrd_perform_updateFunction · 0.85
free_xmlFunction · 0.85

Tested by

no test coverage detected