Commit 42358dde authored by Olivier Crête's avatar Olivier Crête

agent: Don't make relayed sockets available in nice_agent_get_selected_socket()

Also document that fact.
parent 6605d57b
......@@ -2914,10 +2914,15 @@ nice_agent_get_selected_socket (NiceAgent *agent, guint stream_id,
&stream, &component))
goto done;
if (component->selected_pair.local && component->selected_pair.remote) {
nice_socket = (NiceSocket *)component->selected_pair.local->sockptr;
g_socket = nice_socket->fileno;
}
if (!component->selected_pair.local || !component->selected_pair.remote)
goto done;
if (component->selected_pair.local->type == NICE_CANDIDATE_TYPE_RELAYED)
goto done;
nice_socket = (NiceSocket *)component->selected_pair.local->sockptr;
if (nice_socket->fileno)
g_socket = g_object_ref (nice_socket->fileno);
done:
agent_unlock();
......
......@@ -737,7 +737,13 @@ nice_agent_get_selected_pair (
* it. New applications are encouraged to use the built in libnice stream
* handling instead and let libnice handle the connection maintenance.
*
* Returns: pointer to the socket, or NULL if there is no selected candidate
* Users of this method are encouraged to not use a TURN relay or any kind
* of proxy, as in this case, the socket will not be available to the
* application because the packets are encapsulated.
*
* Returns: (transfer full) pointer to the #GSocket, or NULL if there is no
* selected candidate or if the selected candidate is a relayed candidate.
*
* Since: 0.1.5
*/
GSocket *
......
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