Do not return the socket to the app if we use ice-tcp, even in unreliable case
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Wed, 9 Apr 2014 23:54:24 +0000 (19:54 -0400)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 15 May 2014 13:44:00 +0000 (09:44 -0400)
agent/agent.c

index b2cac8b..05baba7 100644 (file)
@@ -4150,6 +4150,10 @@ nice_agent_get_selected_socket (NiceAgent *agent, guint stream_id,
   if (component->selected_pair.local->type == NICE_CANDIDATE_TYPE_RELAYED)
     goto done;
 
+  /* ICE-TCP requires RFC4571 framing, even if unreliable */
+  if (component->selected_pair.local->transport != NICE_CANDIDATE_TRANSPORT_UDP)
+    goto done;
+
   nice_socket = (NiceSocket *)component->selected_pair.local->sockptr;
   if (nice_socket->fileno)
     g_socket = g_object_ref (nice_socket->fileno);