| 57 | } |
| 58 | |
| 59 | static 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 | |
| 88 | static void pack_tuple(b2bl_tuple_t* tuple, bin_packet_t *storage, int repl_new) |
| 89 | { |
no test coverage detected