Skip to content

Commit

Permalink
dialog: lock the slot if old dialog found in state deleted
Browse files Browse the repository at this point in the history
- no longer a spiral condition and new dialog will be created

(cherry picked from commit 7f9194c)
  • Loading branch information
miconda committed Sep 10, 2015
1 parent 3fc2d2c commit 061195f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 3 additions & 1 deletion modules/dialog/dlg_handlers.c
Expand Up @@ -820,7 +820,9 @@ int dlg_new_dialog(sip_msg_t *req, struct cell *t, const int run_initial_cbs)
return 0;
}
dlg_release(dlg);
}
}
/* lock the slot - dlg found, but in dlg_state_deleted, do a new one */
dlg_hash_lock(&callid);
}
spiral_detected = 0;

Expand Down
16 changes: 15 additions & 1 deletion modules/dialog/dlg_hash.c
Expand Up @@ -749,6 +749,21 @@ dlg_cell_t* search_dlg( str *callid, str *ftag, str *ttag, unsigned int *dir)
}


/*!
* \brief Lock hash table slot by call-id
* \param callid call-id value
*/
void dlg_hash_lock(str *callid)
{
unsigned int he;
struct dlg_entry *d_entry;

he = core_hash(callid, 0, d_table->size);
d_entry = &(d_table->entries[he]);
dlg_lock(d_table, d_entry);
}


/*!
* \brief Release hash table slot by call-id
* \param callid call-id value
Expand All @@ -764,7 +779,6 @@ void dlg_hash_release(str *callid)
}



/*!
* \brief Link a dialog structure
* \param dlg dialog
Expand Down
7 changes: 7 additions & 0 deletions modules/dialog/dlg_hash.h
Expand Up @@ -346,6 +346,13 @@ dlg_cell_t* get_dlg(str *callid, str *ftag, str *ttag, unsigned int *dir);
dlg_cell_t* search_dlg(str *callid, str *ftag, str *ttag, unsigned int *dir);


/*!
* \brief Lock hash table slot by call-id
* \param callid call-id value
*/
void dlg_hash_lock(str *callid);


/*!
* \brief Release hash table slot by call-id
* \param callid call-id value
Expand Down

0 comments on commit 061195f

Please sign in to comment.