Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/main/java/org/ice4j/ice/ConnectivityCheckServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,10 @@ public void processRequest(StunMessageEvent evt)
return;
}

//detect role conflicts
if( ( parentAgent.isControlling()
&& request.containsAttribute(Attribute.ICE_CONTROLLING))
|| ( ! parentAgent.isControlling()
&& request.containsAttribute(Attribute.ICE_CONTROLLED)))
{
if (!repairRoleConflict(evt))
return;
}

// Learn the peer reflexive candidate, even if we are going to send a
// role conflict error. This allows us to learn faster, and compensates
// for a buggy peer that doesn't switch roles when it gets a role
// conflict error.
long priority = 0;
boolean useCandidate
= request.containsAttribute(Attribute.USE_CANDIDATE);
Expand All @@ -177,6 +171,16 @@ public void processRequest(StunMessageEvent evt)
evt.getLocalAddress(), priority, remoteUfrag, localUFrag,
useCandidate);

//detect role conflicts
if( ( parentAgent.isControlling()
&& request.containsAttribute(Attribute.ICE_CONTROLLING))
|| ( ! parentAgent.isControlling()
&& request.containsAttribute(Attribute.ICE_CONTROLLED)))
{
if (!repairRoleConflict(evt))
return;
}

Response response = MessageFactory.createBindingResponse(
request, evt.getRemoteAddress());

Expand Down