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

Some improvements to ICE processing.

parent 774ef879
......@@ -296,10 +296,10 @@ static void ice_compute_pair_priority(IceCandidatePair *pair, const IceRole *rol
static IceCandidatePair *ice_pair_new(IceCheckList *cl, IceCandidate* local_candidate, IceCandidate *remote_candidate)
{
IceCandidatePair *pair = ms_new(IceCandidatePair, 1);
IceCandidatePair *pair = ms_new0(IceCandidatePair, 1);
pair->local = local_candidate;
pair->remote = remote_candidate;
ice_pair_set_state(pair, ICP_Frozen);
pair->state = ICP_Frozen;
pair->is_default = FALSE;
pair->is_nominated = FALSE;
pair->use_candidate = FALSE;
......@@ -888,8 +888,10 @@ static void ice_send_binding_request(IceCheckList *cl, IceCandidatePair *pair, c
/* Special case where a binding response triggers a binding request for an InProgress pair. */
/* In this case we wait for the transmission timeout before creating a new binding request for the pair. */
pair->wait_transaction_timeout = FALSE;
ice_pair_set_state(pair, ICP_Waiting);
ice_check_list_queue_triggered_check(cl, pair);
if (pair->use_candidate == FALSE) {
ice_pair_set_state(pair, ICP_Waiting);
ice_check_list_queue_triggered_check(cl, pair);
}
return;
}
/* This is a retransmission: update the number of retransmissions, the retransmission timer value, and the transmission time. */
......@@ -2368,17 +2370,21 @@ static void ice_check_all_pairs_in_failed_or_succeeded_state(const IceCandidateP
}
}
static void ice_pair_stop_retransmissions(IceCandidatePair *pair)
static void ice_pair_stop_retransmissions(IceCandidatePair *pair, IceCheckList *cl)
{
MSList *elem;
if (pair->state == ICP_InProgress) {
/* Set the retransmissions number to the max to stop retransmissions. */
pair->retransmissions = ICE_MAX_RETRANSMISSIONS;
ice_pair_set_state(pair, ICP_Failed);
elem = ms_list_find(cl->triggered_checks_queue, pair);
if (elem != NULL) {
cl->triggered_checks_queue = ms_list_remove_link(cl->triggered_checks_queue, elem);
}
}
}
static void ice_check_list_stop_retransmissions(const IceCheckList *cl)
static void ice_check_list_stop_retransmissions(IceCheckList *cl)
{
ms_list_for_each(cl->check_list, (void (*)(void*))ice_pair_stop_retransmissions);
ms_list_for_each2(cl->check_list, (void (*)(void*,void*))ice_pair_stop_retransmissions, cl);
}
static int ice_find_running_check_list(const IceCheckList *cl)
......@@ -2868,8 +2874,8 @@ static void ice_dump_candidate_pair(const IceCandidatePair *pair, int *i)
char tr_id_str[25];
transactionID2string(&pair->transactionID, tr_id_str);
ms_message("\t%d [%p]: %sstate=%s nominated=%d priority=%llu transactionID=%s", *i, pair, ((pair->is_default == TRUE) ? "* " : " "),
candidate_pair_state_values[pair->state], pair->is_nominated, (long long unsigned) pair->priority, tr_id_str);
ms_message("\t%d [%p]: %sstate=%s use=%d nominated=%d priority=%llu transactionID=%s", *i, pair, ((pair->is_default == TRUE) ? "* " : " "),
candidate_pair_state_values[pair->state], pair->use_candidate, pair->is_nominated, (long long unsigned) pair->priority, tr_id_str);
ice_dump_candidate(pair->local, "\t\tLocal: ");
ice_dump_candidate(pair->remote, "\t\tRemote: ");
(*i)++;
......
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