Skip to content

Commit

Permalink
dialog: run run_load_callbacks() on child_init for rank PROC_INIT
Browse files Browse the repository at this point in the history
- proper test for create_cbs
- based on PR #1606 and #1607 by kosza

(cherry picked from commit 3d0e1f7)
  • Loading branch information
miconda committed Aug 17, 2018
1 parent 29d9126 commit f5c944e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/modules/dialog/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ static int mod_init(void)
LM_ERR("failed to initialize the DB support\n");
return -1;
}
run_load_callbacks();
}

destroy_dlg_callbacks( DLGCB_LOADED );
Expand Down Expand Up @@ -719,6 +718,13 @@ static int child_init(int rank)
{
dlg_db_mode = dlg_db_mode_param;


if(rank==PROC_INIT) {
if (dlg_db_mode!=DB_MODE_NONE) {
run_load_callbacks();
}
}

if(rank==PROC_MAIN) {
if(dlg_timer_procs>0) {
if(fork_sync_timer(PROC_TIMER, "Dialog Main Timer", 1 /*socks flag*/,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/dialog/dlg_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int register_dlgcb(struct dlg_cell *dlg, int types, dialog_cb f,
cb->callback_param_free = ff;

if ( types==DLGCB_CREATED ) {
if (load_cbs==POINTER_CLOSED_MARKER) {
if (create_cbs==POINTER_CLOSED_MARKER) {
LM_CRIT("DLGCB_CREATED type registered after shutdown!?!\n");
goto error;
}
Expand Down

0 comments on commit f5c944e

Please sign in to comment.