MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / send_sync_req

Function send_sync_req

modules/clusterer/sync.c:39–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37static unsigned sync_packets_cnt;
38
39int send_sync_req(str *capability, int cluster_id, int source_id)
40{
41 bin_packet_t packet;
42 int rc;
43
44 if (bin_init(&packet, &cl_extra_cap, CLUSTERER_SYNC_REQ, BIN_SYNC_VERSION, 0) < 0) {
45 LM_ERR("Failed to init bin send buffer\n");
46 return -1;
47 }
48
49 bin_push_str(&packet, capability);
50 msg_add_trailer(&packet, cluster_id, source_id);
51
52 rc = clusterer_send_msg(&packet, cluster_id, source_id, 0, 1);
53 if (rc == CLUSTERER_SEND_SUCCESS)
54 LM_INFO("Sent sync request for capability '%.*s' to node %d, "
55 "cluster %d\n", capability->len, capability->s, source_id,
56 cluster_id);
57
58 bin_free_packet(&packet);
59
60 return rc;
61}
62
63static int get_sync_source(cluster_info_t *cluster, str *capability,
64 enum cl_node_match_op match_cond)

Callers 3

cl_request_syncFunction · 0.85
handle_cap_updateFunction · 0.85
do_actions_node_evFunction · 0.85

Calls 4

bin_push_strFunction · 0.85
msg_add_trailerFunction · 0.85
clusterer_send_msgFunction · 0.85
bin_free_packetFunction · 0.85

Tested by

no test coverage detected