Commit 53e960cb authored by Fabrice Bellet's avatar Fabrice Bellet

conncheck: improve role conflict debug

This patch displays explicitely the controlling or controlled
role of the agent.

Differential Revision:
parent 55aaf76b
......@@ -2933,14 +2933,16 @@ static void priv_check_for_role_conflict (NiceAgent *agent, gboolean control)
/* role conflict, change mode; wait for a new conn. check */
if (control != agent->controlling_mode) {
nice_debug ("Agent %p : Role conflict, changing agent role to %d.", agent, control);
nice_debug ("Agent %p : Role conflict, changing agent role to \"%s\".",
agent, control ? "controlling" : "controlled");
agent->controlling_mode = control;
/* the pair priorities depend on the roles, so recalculation
* is needed */
priv_recalculate_pair_priorities (agent);
nice_debug ("Agent %p : Role conflict, agent role already changed to %d.", agent, control);
nice_debug ("Agent %p : Role conflict, staying with role \"%s\".",
agent, control ? "controlling" : "controlled");
......@@ -3216,6 +3218,21 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStre
/* case: role conflict error, need to restart with new role */
nice_debug ("Agent %p : conncheck %p ROLE CONFLICT, restarting", agent, p);
/* note: this res value indicates that the role of the peer
* agent has not changed after the tie-breaker comparison, so
* this is our role that must change. see ICE sect.
* "Failure Cases". Our role might already have changed due to
* an earlier incoming request, but if not, change role now.
* Sect. is not clear on this point, but we choose to
* put the candidate pair in the triggered check list even
* when the agent did not switch its role. The reason for this
* interpretation is that the reception of the stun reply, even
* an error reply, is a good sign that this pair will be
* valid, if we retry the check after the role of both peers
* has been fixed.
if (p->stun_message.buffer != NULL) {
guint64 tie;
gboolean controlled_mode;
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