Commit d4a7c37c authored by Guillaume Desmottes's avatar Guillaume Desmottes Committed by Olivier Crête

add nice_agent_forget_relays()

parent 69749bad
......@@ -4817,3 +4817,28 @@ nice_agent_get_io_stream (NiceAgent *agent, guint stream_id,
return iostream;
}
NICEAPI_EXPORT gboolean
nice_agent_forget_relays (NiceAgent *agent, guint stream_id, guint component_id)
{
Component *component;
gboolean ret = TRUE;
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
g_return_val_if_fail (stream_id >= 1, FALSE);
g_return_val_if_fail (component_id >= 1, FALSE);
agent_lock ();
if (!agent_find_component (agent, stream_id, component_id, NULL, &component)) {
ret = FALSE;
goto done;
}
component_clean_turn_servers (component);
done:
agent_unlock_and_emit (agent);
return ret;
}
......@@ -1447,6 +1447,26 @@ nice_agent_get_io_stream (
const gchar *
nice_component_state_to_string (NiceComponentState state);
/**
* nice_agent_forget_relays:
* @agent: The #NiceAgent Object
* @stream_id: The ID of the stream
* @component_id: The ID of the component
*
* Forget all the relay servers previously added using
* nice_agent_set_relay_info(). Currently connected streams will keep
* using the relay as long as they have not been restarted and haven't
* succesfully negotiated a different path.
*
* Returns: %FALSE if the component could not be found, %TRUE otherwise
*
* Since: 0.1.6
*/
gboolean
nice_agent_forget_relays (NiceAgent *agent,
guint stream_id,
guint component_id);
G_END_DECLS
#endif /* _AGENT_H */
......
......@@ -17,6 +17,7 @@ nice_agent_set_port_range
nice_agent_add_stream
nice_agent_remove_stream
nice_agent_set_relay_info
nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_set_remote_credentials
nice_agent_get_local_credentials
......
......@@ -21,6 +21,7 @@ nice_agent_recv_messages
nice_agent_recv_nonblocking
nice_agent_recv_messages_nonblocking
nice_agent_attach_recv
nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp
nice_agent_generate_local_sdp
......
......@@ -21,6 +21,7 @@ nice_address_to_string
nice_agent_add_local_address
nice_agent_add_stream
nice_agent_attach_recv
nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp
nice_agent_generate_local_sdp
......
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