| 358 | |
| 359 | #if SUPPORT_COROSYNC |
| 360 | static gboolean |
| 361 | attrd_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 | |
| 398 | static void |
| 399 | attrd_ais_destroy(gpointer unused) |
nothing calls this directly
no test coverage detected