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

Function pcmk_ipc_dispatch

mcp/pacemaker.c:459–491  ·  view source on GitHub ↗

Exit code means? */

Source from the content-addressed store, hash-verified

457
458/* Exit code means? */
459static int32_t
460pcmk_ipc_dispatch(qb_ipcs_connection_t *c, void *data, size_t size)
461{
462 uint32_t id = 0;
463 uint32_t flags = 0;
464 const char *task = NULL;
465 xmlNode *msg = crm_ipcs_recv(c, data, size, &id, &flags);
466
467 crm_trace("Message from %p", c);
468 if(flags & crm_ipc_client_response) {
469 crm_ipcs_send_ack(c, id, "ack", __FUNCTION__, __LINE__);
470 }
471
472 if (msg == NULL) {
473 return 0;
474 }
475
476 task = crm_element_value(msg, F_CRM_TASK);
477 if(crm_str_eq(task, CRM_OP_QUIT, TRUE)) {
478 /* Time to quit */
479 crm_notice("Shutting down in responce to ticket %s (%s)",
480 crm_element_value(msg, F_CRM_REFERENCE),
481 crm_element_value(msg, F_CRM_ORIGIN));
482 pcmk_shutdown(15);
483
484 } else {
485 /* Just send to everyone */
486 update_process_clients();
487 }
488
489 free_xml(msg);
490 return 0;
491}
492
493/* Error code means? */
494static int32_t

Callers

nothing calls this directly

Calls 7

crm_ipcs_recvFunction · 0.85
crm_ipcs_send_ackFunction · 0.85
crm_element_valueFunction · 0.85
crm_str_eqFunction · 0.85
update_process_clientsFunction · 0.85
free_xmlFunction · 0.85
pcmk_shutdownFunction · 0.70

Tested by

no test coverage detected