Commit f8a095da authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Fix peer reflexive priority depending on transport and compatibility

parent f93f37f4
......@@ -576,9 +576,8 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
continue;
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
guint32 priority = nice_candidate_ice_priority_full (
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE, 1,
p->local->component_id);
NiceCandidate *candidate_priority;
guint32 priority;
uint8_t uname[NICE_STREAM_MAX_UNAME];
size_t uname_len =
priv_create_username (agent, agent_find_stream (agent, stream->id),
......@@ -588,6 +587,13 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
size_t password_len = priv_get_password (agent,
agent_find_stream (agent, stream->id), p->remote, &password);
candidate_priority = nice_candidate_new (
NICE_CANDIDATE_TYPE_PEER_REFLEXIVE);
candidate_priority->transport = p->local->transport;
candidate_priority->component_id = p->local->component_id;
priority = nice_candidate_jingle_priority (candidate_priority);
nice_candidate_free (candidate_priority);
if (nice_debug_is_enabled ()) {
gchar tmpbuf[INET6_ADDRSTRLEN];
nice_address_to_string (&p->remote->addr, tmpbuf);
......@@ -1683,12 +1689,8 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
* - ICE-CONTROLLED/ICE-CONTROLLING (for role conflicts)
* - USE-CANDIDATE (if sent by the controlling agent)
*/
guint32 priority =
nice_candidate_ice_priority_full (
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE,
1,
pair->local->component_id);
NiceCandidate *candidate_priority;
guint32 priority;
uint8_t uname[NICE_STREAM_MAX_UNAME];
gsize uname_len =
......@@ -1704,6 +1706,20 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
size_t buffer_len;
unsigned int timeout;
candidate_priority = nice_candidate_new (NICE_CANDIDATE_TYPE_PEER_REFLEXIVE);
candidate_priority->transport = pair->local->transport;
candidate_priority->component_id = pair->local->component_id;
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
priority = nice_candidate_jingle_priority (candidate_priority);
} else if (agent->compatibility == NICE_COMPATIBILITY_MSN ||
agent->compatibility == NICE_COMPATIBILITY_OC2007) {
priority = nice_candidate_msn_priority (candidate_priority);
} else {
priority = nice_candidate_ice_priority (candidate_priority,
agent->reliable, FALSE);
}
nice_candidate_free (candidate_priority);
if (password != NULL &&
(agent->compatibility == NICE_COMPATIBILITY_MSN ||
agent->compatibility == NICE_COMPATIBILITY_OC2007)) {
......
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