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

Function ipc_dispatch_buf_pkt

modules/clusterer/sync.c:495–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495int ipc_dispatch_buf_pkt(struct buf_bin_pkt *buf_pkt,
496 struct capability_reg *cap, int source_id)
497{
498 struct packet_rpc_params *params;
499
500 params = shm_malloc(sizeof *params + (buf_pkt ? buf_pkt->buf.len : 0));
501 if (!params) {
502 LM_ERR("oom!\n");
503 return -1;
504 }
505 memset(params, 0, sizeof *params);
506
507 if (buf_pkt) {
508 params->pkt_buf.s = (char *)(params + 1);
509 memcpy(params->pkt_buf.s, buf_pkt->buf.s, buf_pkt->buf.len);
510 params->pkt_buf.len = buf_pkt->buf.len;
511 }
512
513 params->pkt_src_id = source_id;
514 params->cap = cap;
515
516 if (ipc_dispatch_rpc(run_cb_buf_pkt, params) < 0) {
517 LM_ERR("Failed to dispatch rpc\n");
518 return -1;
519 }
520
521 return 0;
522}
523
524void handle_sync_end(cluster_info_t *cluster, struct local_cap *cap,
525 int source_id, int no_sync_chunks, int is_timeout)

Callers 1

handle_sync_endFunction · 0.85

Calls 2

shm_mallocFunction · 0.85
ipc_dispatch_rpcFunction · 0.85

Tested by

no test coverage detected