Commit a04d1eac authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix wrong check for end of ICE processing.

If the processing of the last check list finished before the processing of a previous check list the end of ICE processing was not notified to the application.
parent d86371cd
...@@ -2148,6 +2148,11 @@ static void ice_check_list_stop_retransmissions(const IceCheckList *cl) ...@@ -2148,6 +2148,11 @@ static void ice_check_list_stop_retransmissions(const IceCheckList *cl)
ms_list_for_each(cl->check_list, (void (*)(void*))ice_pair_stop_retransmissions); ms_list_for_each(cl->check_list, (void (*)(void*))ice_pair_stop_retransmissions);
} }
static int ice_find_running_check_list(const IceCheckList *cl)
{
return !(cl->state == ICL_Running);
}
static int ice_find_unsuccessful_check_list(IceCheckList *cl, const void *dummy) static int ice_find_unsuccessful_check_list(IceCheckList *cl, const void *dummy)
{ {
return (cl->state == ICL_Completed); return (cl->state == ICL_Completed);
...@@ -2160,7 +2165,7 @@ static void ice_continue_processing_on_next_check_list(IceCheckList *cl, RtpSess ...@@ -2160,7 +2165,7 @@ static void ice_continue_processing_on_next_check_list(IceCheckList *cl, RtpSess
ms_error("ice: Could not find check list in the session"); ms_error("ice: Could not find check list in the session");
return; return;
} }
elem = ms_list_next(elem); elem = ms_list_find(cl->session->streams, (void (*)(void*))ice_find_running_check_list);
if (elem == NULL) { if (elem == NULL) {
/* This was the last check list of the session. */ /* This was the last check list of the session. */
elem = ms_list_find_custom(cl->session->streams, (MSCompareFunc)ice_find_unsuccessful_check_list, NULL); elem = ms_list_find_custom(cl->session->streams, (MSCompareFunc)ice_find_unsuccessful_check_list, NULL);
...@@ -2207,11 +2212,11 @@ static void ice_conclude_processing(IceCheckList *cl, RtpSession *rtp_session) ...@@ -2207,11 +2212,11 @@ static void ice_conclude_processing(IceCheckList *cl, RtpSession *rtp_session)
/* Initialise keepalive time. */ /* Initialise keepalive time. */
cl->keepalive_time = cl->session->ticker->time; cl->keepalive_time = cl->session->ticker->time;
ice_check_list_stop_retransmissions(cl); ice_check_list_stop_retransmissions(cl);
ice_continue_processing_on_next_check_list(cl, rtp_session);
/* Notify the application of the successful processing. */ /* Notify the application of the successful processing. */
ev = ortp_event_new(ORTP_EVENT_ICE_CHECK_LIST_PROCESSING_FINISHED); ev = ortp_event_new(ORTP_EVENT_ICE_CHECK_LIST_PROCESSING_FINISHED);
ortp_event_get_data(ev)->info.ice_processing_successful = TRUE; ortp_event_get_data(ev)->info.ice_processing_successful = TRUE;
rtp_session_dispatch_event(rtp_session, ev); rtp_session_dispatch_event(rtp_session, ev);
ice_continue_processing_on_next_check_list(cl, rtp_session);
} }
} else { } else {
cb.cl = cl; cb.cl = cl;
......
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