Manually formats (while reading the source code in the context of early DTLS support) for consistency.
This commit is contained in:
parent
ed15e98916
commit
edd325a973
@ -707,7 +707,7 @@ public class Agent
|
||||
synchronized(stateListeners)
|
||||
{
|
||||
if(!stateListeners.contains(l))
|
||||
this.stateListeners.add(l);
|
||||
stateListeners.add(l);
|
||||
}
|
||||
}
|
||||
|
||||
@ -721,7 +721,7 @@ public class Agent
|
||||
{
|
||||
synchronized(stateListeners)
|
||||
{
|
||||
this.stateListeners.remove(l);
|
||||
stateListeners.remove(l);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1638,8 +1638,10 @@ public class Agent
|
||||
throws IllegalStateException
|
||||
{
|
||||
if(!isControlling())
|
||||
throw new IllegalStateException("Only controlling agents can "
|
||||
+"nominate pairs");
|
||||
{
|
||||
throw new IllegalStateException(
|
||||
"Only controlling agents can nominate pairs");
|
||||
}
|
||||
|
||||
Component parentComponent = pair.getParentComponent();
|
||||
IceMediaStream parentStream = parentComponent.getParentStream();
|
||||
@ -1652,8 +1654,7 @@ public class Agent
|
||||
{
|
||||
logger.info("verify if nominated pair answer again");
|
||||
pair.nominate();
|
||||
pair.getParentComponent().getParentStream()
|
||||
.getCheckList().scheduleTriggeredCheck(pair);
|
||||
parentStream.getCheckList().scheduleTriggeredCheck(pair);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -131,7 +131,6 @@ public class CandidatePair
|
||||
public CandidatePair(LocalCandidate localCandidate,
|
||||
RemoteCandidate remoteCandidate)
|
||||
{
|
||||
|
||||
this.localCandidate = localCandidate;
|
||||
this.remoteCandidate = remoteCandidate;
|
||||
|
||||
@ -449,9 +448,9 @@ public class CandidatePair
|
||||
|
||||
CandidatePair candidatePair = (CandidatePair) obj;
|
||||
|
||||
//DO NOT change this method to also depend on other pair properties
|
||||
//because the Conn Check Client counts on it only using the candidates
|
||||
//for comparisons.
|
||||
// XXX DO NOT change this method to also depend on other pair properties
|
||||
// because ConnectivityCheckClient counts on it only using the
|
||||
// candidates for comparisons.
|
||||
return
|
||||
localCandidate.equals(candidatePair.localCandidate)
|
||||
&& remoteCandidate.equals(candidatePair.remoteCandidate);
|
||||
@ -616,8 +615,8 @@ public class CandidatePair
|
||||
getParentComponent().getParentStream().firePairPropertyChange(
|
||||
this,
|
||||
IceMediaStream.PROPERTY_PAIR_NOMINATED,
|
||||
false,
|
||||
true);
|
||||
/* oldValue */ false,
|
||||
/* newValue */ true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -383,9 +383,9 @@ public class CheckList
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info("Selected pair for stream " +
|
||||
cmp.toShortString() + ": " +
|
||||
nominatedPair.toShortString());
|
||||
logger.info(
|
||||
"Selected pair for stream " + cmp.toShortString() + ": "
|
||||
+ nominatedPair.toShortString());
|
||||
|
||||
cmp.setSelectedPair(nominatedPair);
|
||||
|
||||
|
||||
@ -496,11 +496,11 @@ class ConnectivityCheckClient
|
||||
}
|
||||
|
||||
XorMappedAddressAttribute mappedAddressAttr
|
||||
= (XorMappedAddressAttribute)response
|
||||
.getAttribute(Attribute.XOR_MAPPED_ADDRESS);
|
||||
= (XorMappedAddressAttribute)
|
||||
response.getAttribute(Attribute.XOR_MAPPED_ADDRESS);
|
||||
|
||||
mappedAddress = mappedAddressAttr
|
||||
.getAddress(response.getTransactionID());
|
||||
mappedAddress
|
||||
= mappedAddressAttr.getAddress(response.getTransactionID());
|
||||
|
||||
// XXX AddressAttribute always returns UDP based TransportAddress
|
||||
if (checkedPair.getLocalCandidate().getTransport() == Transport.TCP)
|
||||
@ -514,8 +514,7 @@ class ConnectivityCheckClient
|
||||
|
||||
LocalCandidate validLocalCandidate = null;
|
||||
|
||||
validLocalCandidate = parentAgent
|
||||
.findLocalCandidate(mappedAddress);
|
||||
validLocalCandidate = parentAgent.findLocalCandidate(mappedAddress);
|
||||
|
||||
RemoteCandidate validRemoteCandidate = checkedPair.getRemoteCandidate();
|
||||
|
||||
@ -558,8 +557,11 @@ class ConnectivityCheckClient
|
||||
validLocalCandidate = peerReflexiveCandidate;
|
||||
|
||||
if (checkedPair.getParentComponent().getSelectedPair() == null)
|
||||
logger.info("Receive a peer-reflexive candidate: " +
|
||||
peerReflexiveCandidate.getTransportAddress());
|
||||
{
|
||||
logger.info(
|
||||
"Receive a peer-reflexive candidate: "
|
||||
+ peerReflexiveCandidate.getTransportAddress());
|
||||
}
|
||||
}
|
||||
|
||||
//check if the resulting valid pair was already in our check lists.
|
||||
@ -607,8 +609,8 @@ class ConnectivityCheckClient
|
||||
|
||||
//The agent changes the states for all other Frozen pairs for the
|
||||
//same media stream and same foundation to Waiting.
|
||||
IceMediaStream parentStream = checkedPair.getParentComponent()
|
||||
.getParentStream();
|
||||
IceMediaStream parentStream
|
||||
= checkedPair.getParentComponent().getParentStream();
|
||||
|
||||
synchronized(this)
|
||||
{
|
||||
@ -616,11 +618,15 @@ class ConnectivityCheckClient
|
||||
= new Vector<>(parentStream.getCheckList());
|
||||
|
||||
for(CandidatePair pair : parentCheckList)
|
||||
if ((pair.getState() == CandidatePairState.FROZEN)
|
||||
{
|
||||
if (pair.getState() == CandidatePairState.FROZEN
|
||||
&& checkedPair.getFoundation().equals(
|
||||
pair.getFoundation()))
|
||||
{
|
||||
pair.setStateWaiting();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The agent examines the check list for all other streams in turn. If
|
||||
// the check list is active, the agent changes the state of all Frozen
|
||||
@ -674,8 +680,8 @@ class ConnectivityCheckClient
|
||||
//If the agent was a controlling agent, and it had included a USE-
|
||||
//CANDIDATE attribute in the Binding request, the valid pair generated
|
||||
//from that check has its nominated flag set to true.
|
||||
if((parentAgent.isControlling()
|
||||
&& request.containsAttribute(Attribute.USE_CANDIDATE)))
|
||||
if (parentAgent.isControlling()
|
||||
&& request.containsAttribute(Attribute.USE_CANDIDATE))
|
||||
{
|
||||
if(validPair.getParentComponent().getSelectedPair() == null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user