Skip to content

Commit

Permalink
dialog: use static holders for statistics loaded at startup
Browse files Browse the repository at this point in the history
This prevents OpenSIPS from crashing because the statistics were not yet
initialized. This fix is needed due to the revert of the previous two
commits, related to the start of OpenSIPS on child init.
  • Loading branch information
razvancrainea committed Aug 22, 2019
1 parent 21c013e commit 795395f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions modules/dialog/dlg_db_handler.c
Expand Up @@ -605,12 +605,6 @@ static int load_dialog_info_from_db(int dlg_hash_size)
dlg->start_ts = VAL_INT(values+6);

dlg->state = VAL_INT(values+7);
if (dlg->state==DLG_STATE_CONFIRMED_NA ||
dlg->state==DLG_STATE_CONFIRMED) {
active_dlgs_cnt++;
} else if (dlg->state==DLG_STATE_EARLY) {
early_dlgs_cnt++;
}

GET_STR_VALUE(cseq1, values, 9 , 1, 1);
GET_STR_VALUE(cseq2, values, 10 , 1, 1);
Expand Down Expand Up @@ -737,8 +731,12 @@ static int load_dialog_info_from_db(int dlg_hash_size)
ref_dlg_unsafe(dlg, 1);
}

update_dlg_stats(dlg, +1);

if (dlg->state==DLG_STATE_CONFIRMED_NA ||
dlg->state==DLG_STATE_CONFIRMED) {
active_dlgs_cnt++;
} else if (dlg->state==DLG_STATE_EARLY) {
early_dlgs_cnt++;
}
run_load_callback_per_dlg(dlg);

next_dialog:;
Expand Down

0 comments on commit 795395f

Please sign in to comment.