summaryrefslogtreecommitdiff
path: root/agent/candidate.c
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2014-04-08 21:26:42 -0400
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2014-05-15 09:44:00 -0400
commit3045c9b59785b0986623894d699477394eb73a68 (patch)
tree21511828792272d22680933fdb8343a065ffdc1c /agent/candidate.c
parent218667da2ad1411b4ab722858e67c2a8c7e716e8 (diff)
downloadlibnice-3045c9b59785b0986623894d699477394eb73a68.tar.gz
Change priority algorithm for better values
Now we will always give a handicap to UDP candidates, but still give relays the lower priority. We have the following priorities now : In reliable mode : TCP Host : 120 TCP peer-refl : 110 TCP nat-assist : 105 TCP srv-refl : 100 UDP Host : 60 UDP peer-refl : 55 UDP nat-assist : 52 UDP srv-refl : 50 TCP relay : 10 UDP relay : 5 In unreliable mode : UDP Host : 120 UDP peer-refl : 110 UDP nat-assist : 105 UDP srv-refl : 100 TCP Host : 60 TCP peer-refl : 55 TCP nat-assist : 52 TCP srv-refl : 50 UDP relay : 10 TCP relay : 5
Diffstat (limited to 'agent/candidate.c')
-rw-r--r--agent/candidate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/agent/candidate.c b/agent/candidate.c
index 06d3894..6874042 100644
--- a/agent/candidate.c
+++ b/agent/candidate.c
@@ -207,10 +207,9 @@ nice_candidate_ice_priority (const NiceCandidate *candidate,
break;
}
- if (reliable && candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP) {
- type_preference = NICE_CANDIDATE_TYPE_PREF_UDP_TUNNELED;
- } else if (!reliable && candidate->transport != NICE_CANDIDATE_TRANSPORT_UDP) {
- type_preference = type_preference / 2 - 1;
+ if ((reliable && candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP) ||
+ (!reliable && candidate->transport != NICE_CANDIDATE_TRANSPORT_UDP)) {
+ type_preference = type_preference / 2;
}
local_preference = nice_candidate_ice_local_priority (candidate);