Commit edaccc6f authored by Jakub Adam's avatar Jakub Adam Committed by Youness Alaoui

MS-TURN: comments and fixes

Added comment explaining need of nice_turn_socket_set_ms_... functions
in priv_map_reply_to_relay_request().

Fixed bug in nice_turn_socket_new() where by accident I put both  STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
and STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS as usage flags to
stun_agent_init().
parent dc8badef
......@@ -2335,8 +2335,14 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
priv_add_new_turn_refresh (d, relay_cand, lifetime);
if (agent->compatibility == NICE_COMPATIBILITY_OC2007 ||
agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
nice_turn_socket_set_ms_realm(relay_cand->sockptr, &d->stun_message);
nice_turn_socket_set_ms_connection_id(relay_cand->sockptr, resp);
/* These data are needed on TURN socket when sending requests,
* but never reach nice_turn_socket_parse_recv() where it could
* be read directly, as the socket does not exist when allocate
* response arrives to _nice_agent_recv(). We must set them right
* after socket gets created in discovery_add_relay_candidate(),
* so we are doing it here. */
nice_turn_socket_set_ms_realm(relay_cand->sockptr, &d->stun_message);
nice_turn_socket_set_ms_connection_id(relay_cand->sockptr, resp);
}
}
......
......@@ -141,7 +141,6 @@ nice_turn_socket_new (NiceAgent *agent, NiceAddress *addr,
} else if (compatibility == NICE_TURN_SOCKET_COMPATIBILITY_OC2007) {
stun_agent_init (&priv->agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_OC2007,
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS |
STUN_AGENT_USAGE_NO_INDICATION_AUTH |
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS |
STUN_AGENT_USAGE_NO_ALIGNED_ATTRIBUTES);
......
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