Skip to content

Commit

Permalink
dialog: skip printing profiles and vars in terminated state for rpc d…
Browse files Browse the repository at this point in the history
…ialog list

- they can be delelted at that point, not being referenced by the same
field

(cherry picked from commit 8bc037b)
(cherry picked from commit 9be00ce)
  • Loading branch information
miconda committed Apr 25, 2018
1 parent a8c0d3d commit 90f618d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/dialog/dialog.c
Expand Up @@ -1478,7 +1478,7 @@ static inline void internal_rpc_print_dlg(rpc_t *rpc, void *c, dlg_cell_t *dlg,
"socket", dlg->bind_addr[DLG_CALLEE_LEG] ? &dlg->bind_addr[DLG_CALLEE_LEG]->sock_str : &empty_str);

if (rpc->struct_add(h, "[", "profiles", &sh) < 0) goto error;
for (pl = dlg->profile_links ; pl ; pl=pl->next) {
for (pl = dlg->profile_links ; pl && (dlg->state<DLG_STATE_DELETED) ; pl=pl->next) {
if (pl->profile->has_value) {
rpc->array_add(sh, "{", &ssh);
rpc->struct_add(ssh, "S", pl->profile->name.s, &pl->hash_linker.value);
Expand All @@ -1488,7 +1488,7 @@ static inline void internal_rpc_print_dlg(rpc_t *rpc, void *c, dlg_cell_t *dlg,
}

if (rpc->struct_add(h, "[", "variables", &sh) < 0) goto error;
for(var=dlg->vars ; var ; var=var->next) {
for(var=dlg->vars ; var && (dlg->state<DLG_STATE_DELETED) ; var=var->next) {
rpc->array_add(sh, "{", &ssh);
rpc->struct_add(ssh, "S", var->key.s, &var->value);
}
Expand Down

0 comments on commit 90f618d

Please sign in to comment.