Manually formats (while reading the source code in the context of early DTLS support) for consistency.

This commit is contained in:
Lyubomir Marinov 2016-03-22 22:42:37 -05:00
parent ed15e98916
commit edd325a973
7 changed files with 73 additions and 67 deletions

View File

@ -707,7 +707,7 @@ public class Agent
synchronized(stateListeners) synchronized(stateListeners)
{ {
if(!stateListeners.contains(l)) if(!stateListeners.contains(l))
this.stateListeners.add(l); stateListeners.add(l);
} }
} }
@ -721,7 +721,7 @@ public class Agent
{ {
synchronized(stateListeners) synchronized(stateListeners)
{ {
this.stateListeners.remove(l); stateListeners.remove(l);
} }
} }
@ -1638,8 +1638,10 @@ public class Agent
throws IllegalStateException throws IllegalStateException
{ {
if(!isControlling()) if(!isControlling())
throw new IllegalStateException("Only controlling agents can " {
+"nominate pairs"); throw new IllegalStateException(
"Only controlling agents can nominate pairs");
}
Component parentComponent = pair.getParentComponent(); Component parentComponent = pair.getParentComponent();
IceMediaStream parentStream = parentComponent.getParentStream(); IceMediaStream parentStream = parentComponent.getParentStream();
@ -1652,8 +1654,7 @@ public class Agent
{ {
logger.info("verify if nominated pair answer again"); logger.info("verify if nominated pair answer again");
pair.nominate(); pair.nominate();
pair.getParentComponent().getParentStream() parentStream.getCheckList().scheduleTriggeredCheck(pair);
.getCheckList().scheduleTriggeredCheck(pair);
} }
} }

View File

@ -131,7 +131,6 @@ public class CandidatePair
public CandidatePair(LocalCandidate localCandidate, public CandidatePair(LocalCandidate localCandidate,
RemoteCandidate remoteCandidate) RemoteCandidate remoteCandidate)
{ {
this.localCandidate = localCandidate; this.localCandidate = localCandidate;
this.remoteCandidate = remoteCandidate; this.remoteCandidate = remoteCandidate;
@ -449,9 +448,9 @@ public class CandidatePair
CandidatePair candidatePair = (CandidatePair) obj; CandidatePair candidatePair = (CandidatePair) obj;
//DO NOT change this method to also depend on other pair properties // XXX DO NOT change this method to also depend on other pair properties
//because the Conn Check Client counts on it only using the candidates // because ConnectivityCheckClient counts on it only using the
//for comparisons. // candidates for comparisons.
return return
localCandidate.equals(candidatePair.localCandidate) localCandidate.equals(candidatePair.localCandidate)
&& remoteCandidate.equals(candidatePair.remoteCandidate); && remoteCandidate.equals(candidatePair.remoteCandidate);
@ -616,8 +615,8 @@ public class CandidatePair
getParentComponent().getParentStream().firePairPropertyChange( getParentComponent().getParentStream().firePairPropertyChange(
this, this,
IceMediaStream.PROPERTY_PAIR_NOMINATED, IceMediaStream.PROPERTY_PAIR_NOMINATED,
false, /* oldValue */ false,
true); /* newValue */ true);
} }
/** /**

View File

@ -383,9 +383,9 @@ public class CheckList
return; return;
} }
logger.info("Selected pair for stream " + logger.info(
cmp.toShortString() + ": " + "Selected pair for stream " + cmp.toShortString() + ": "
nominatedPair.toShortString()); + nominatedPair.toShortString());
cmp.setSelectedPair(nominatedPair); cmp.setSelectedPair(nominatedPair);

View File

@ -496,11 +496,11 @@ class ConnectivityCheckClient
} }
XorMappedAddressAttribute mappedAddressAttr XorMappedAddressAttribute mappedAddressAttr
= (XorMappedAddressAttribute)response = (XorMappedAddressAttribute)
.getAttribute(Attribute.XOR_MAPPED_ADDRESS); response.getAttribute(Attribute.XOR_MAPPED_ADDRESS);
mappedAddress = mappedAddressAttr mappedAddress
.getAddress(response.getTransactionID()); = mappedAddressAttr.getAddress(response.getTransactionID());
// XXX AddressAttribute always returns UDP based TransportAddress // XXX AddressAttribute always returns UDP based TransportAddress
if (checkedPair.getLocalCandidate().getTransport() == Transport.TCP) if (checkedPair.getLocalCandidate().getTransport() == Transport.TCP)
@ -514,8 +514,7 @@ class ConnectivityCheckClient
LocalCandidate validLocalCandidate = null; LocalCandidate validLocalCandidate = null;
validLocalCandidate = parentAgent validLocalCandidate = parentAgent.findLocalCandidate(mappedAddress);
.findLocalCandidate(mappedAddress);
RemoteCandidate validRemoteCandidate = checkedPair.getRemoteCandidate(); RemoteCandidate validRemoteCandidate = checkedPair.getRemoteCandidate();
@ -558,8 +557,11 @@ class ConnectivityCheckClient
validLocalCandidate = peerReflexiveCandidate; validLocalCandidate = peerReflexiveCandidate;
if (checkedPair.getParentComponent().getSelectedPair() == null) 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. //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 //The agent changes the states for all other Frozen pairs for the
//same media stream and same foundation to Waiting. //same media stream and same foundation to Waiting.
IceMediaStream parentStream = checkedPair.getParentComponent() IceMediaStream parentStream
.getParentStream(); = checkedPair.getParentComponent().getParentStream();
synchronized(this) synchronized(this)
{ {
@ -616,11 +618,15 @@ class ConnectivityCheckClient
= new Vector<>(parentStream.getCheckList()); = new Vector<>(parentStream.getCheckList());
for(CandidatePair pair : parentCheckList) for(CandidatePair pair : parentCheckList)
if ((pair.getState() == CandidatePairState.FROZEN) {
if (pair.getState() == CandidatePairState.FROZEN
&& checkedPair.getFoundation().equals( && checkedPair.getFoundation().equals(
pair.getFoundation())) pair.getFoundation()))
{
pair.setStateWaiting(); pair.setStateWaiting();
} }
}
}
// The agent examines the check list for all other streams in turn. If // 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 // 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- //If the agent was a controlling agent, and it had included a USE-
//CANDIDATE attribute in the Binding request, the valid pair generated //CANDIDATE attribute in the Binding request, the valid pair generated
//from that check has its nominated flag set to true. //from that check has its nominated flag set to true.
if((parentAgent.isControlling() if (parentAgent.isControlling()
&& request.containsAttribute(Attribute.USE_CANDIDATE))) && request.containsAttribute(Attribute.USE_CANDIDATE))
{ {
if(validPair.getParentComponent().getSelectedPair() == null) if(validPair.getParentComponent().getSelectedPair() == null)
{ {