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

Function unpack_context_vals

modules/b2b_logic/entity_storage.c:59–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static int unpack_context_vals(b2bl_tuple_t* tuple, bin_packet_t *storage)
60{
61 int no_vals;
62 int i;
63 str name, val;
64 struct b2b_ctx_val *v;
65
66 /* clear existing values; this way, the values should always
67 * be consistent between instances */
68 while (tuple->vals) {
69 v = tuple->vals;
70 tuple->vals = tuple->vals->next;
71 shm_free(v);
72 }
73
74 bin_pop_int(storage, &no_vals);
75 for (i = 0; i < no_vals; i++) {
76 bin_pop_str(storage, &name);
77 bin_pop_str(storage, &val);
78
79 if (store_ctx_value(&tuple->vals, &name, &val) < 0) {
80 LM_ERR("Failed to store context value [%.*s]\n", name.len,name.s);
81 return -1;
82 }
83 }
84
85 return 0;
86}
87
88static void pack_tuple(b2bl_tuple_t* tuple, bin_packet_t *storage, int repl_new)
89{

Callers 5

receive_entity_createFunction · 0.85
receive_entity_updateFunction · 0.85
receive_entity_ackFunction · 0.85
receive_entity_deleteFunction · 0.85
entity_event_receivedFunction · 0.85

Calls 4

shm_freeFunction · 0.85
bin_pop_intFunction · 0.85
bin_pop_strFunction · 0.85
store_ctx_valueFunction · 0.85

Tested by

no test coverage detected