Only use pseudossl for OC2007 if turn type is TLS
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Sat, 19 Apr 2014 01:44:30 +0000 (21:44 -0400)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Sat, 17 May 2014 04:22:36 +0000 (00:22 -0400)
agent/agent.c

index f5562ee..6a48595 100644 (file)
@@ -1858,7 +1858,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
   cdisco = g_slice_new0 (CandidateDiscovery);
   cdisco->type = NICE_CANDIDATE_TYPE_RELAYED;
 
-  if (turn->type ==  NICE_RELAY_TYPE_TURN_UDP) {
+  if (turn->type == NICE_RELAY_TYPE_TURN_UDP) {
     if (agent->use_ice_udp == FALSE) {
       g_slice_free (CandidateDiscovery, cdisco);
       return;
@@ -1939,8 +1939,9 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
         agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
       nicesock = nice_pseudossl_socket_new (nicesock,
           NICE_PSEUDOSSL_SOCKET_COMPATIBILITY_GOOGLE);
-    } else if (agent->compatibility == NICE_COMPATIBILITY_OC2007 ||
-        agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
+    } else if (turn->type == NICE_RELAY_TYPE_TURN_TLS &&
+        (agent->compatibility == NICE_COMPATIBILITY_OC2007 ||
+            agent->compatibility == NICE_COMPATIBILITY_OC2007R2)) {
       nicesock = nice_pseudossl_socket_new (nicesock,
           NICE_PSEUDOSSL_SOCKET_COMPATIBILITY_MSOC);
     }