Commit 0d8287da authored by Ghislain MARY's avatar Ghislain MARY

Update ICE session state when removing a check list.

If all remaining check lists are completed, set the ice session state to completed.
parent 43c71f20
......@@ -822,6 +822,8 @@ void ice_session_add_check_list(IceSession *session, IceCheckList *cl, unsigned
void ice_session_remove_check_list(IceSession *session, IceCheckList *cl)
{
int i;
bool_t keep_session_state = FALSE;
for (i = 0; i < ICE_SESSION_MAX_CHECK_LISTS; i++) {
if ((session->streams[i] != NULL) && (session->streams[i] == cl)) {
ice_check_list_destroy(cl);
......@@ -829,6 +831,16 @@ void ice_session_remove_check_list(IceSession *session, IceCheckList *cl)
break;
}
}
// If all remaining check lists have completed set the session state to completed
for (i = 0; i < ICE_SESSION_MAX_CHECK_LISTS; i++) {
if ((session->streams[i] != NULL) && (ice_check_list_state(session->streams[i]) != ICL_Completed)) {
keep_session_state = TRUE;
}
}
if (!keep_session_state) {
session->state = IS_Completed;
}
}
void ice_session_remove_check_list_from_idx(IceSession *session, unsigned int idx) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment