Applies patch 1, 2, 3, 4 and 7 from Daniel Pocock: [jitsi-dev] refreshing patches.

This commit is contained in:
chenzo 2012-07-06 15:39:46 +00:00
parent 891392e18a
commit 25574cea72
6 changed files with 104 additions and 54 deletions

View File

@ -125,6 +125,11 @@ public class StackProperties
public static final String NOMINATION_TIMER
= "org.ice4j.NOMINATION_TIMER";
/**
* The name of the property used to disabled IPv6 support.
*/
public static final String ENABLE_IPv6 = "org.ice4j.ipv6.DISABLED";
/**
* Returns the String value of the specified property (minus all
* encompassing whitespaces)and null in case no property value was mapped
@ -190,4 +195,34 @@ public class StackProperties
}
return intValue;
}
/**
* Gets the value of a specific property as a boolean. If the specified
* property name is associated with a value in this
* <code>ConfigurationService</code>, the string representation of the value
* is parsed into a boolean according to the rules of
* {@link Boolean#parseBoolean(String)} . Otherwise,
* <code>defaultValue</code> is returned.
*
* @param propertyName
* the name of the property to get the value of as a boolean
* @param defaultValue
* the value to be returned if the specified property name is not
* associated with a value in this
* <code>ConfigurationService</code>
* @return the value of the property with the specified name in this
* <code>ConfigurationService</code> as a boolean;
* <code>defaultValue</code> if the property with the specified name
* is not associated with a value in this
* <code>ConfigurationService</code>
*/
public static boolean getBoolean(String propertyName, boolean defaultValue)
{
String stringValue = getString(propertyName);
return (stringValue == null)
? defaultValue
: Boolean.parseBoolean(stringValue);
}
}

View File

@ -686,7 +686,7 @@ public abstract class Candidate
@Override
public String toString()
{
StringBuilder buff = new StringBuilder("candidate: ");
StringBuilder buff = new StringBuilder("candidate:");
buff.append(getFoundation());
buff.append(" ").append(getParentComponent().getComponentID());

View File

@ -850,11 +850,14 @@ class ConnectivityCheckClient
}
else
{
logger.fine("Received an unrecoverable error response for pair "
+ pair.toShortString() +
" will mark the pair as FAILED.");
logger.info("Error response for pair: " + pair.toShortString() +
", failing.");
int code = cl * 100 + co;
logger.fine(
"Received an unrecoverable error response (code = " + code
+ ") for pair " + pair.toShortString() +
" will mark the pair as FAILED.");
logger.info(
"Error response for pair: " + pair.toShortString() +
", failing. Code = " + code);
pair.setStateFailed();
}
}

View File

@ -67,6 +67,10 @@ public class HostCandidateHarvester
Enumeration<NetworkInterface> interfaces
= NetworkInterface.getNetworkInterfaces();
boolean isIPv6Disabled = StackProperties.getBoolean(
"org.ice4j.ipv6.DISABLED",
false);
if(transport != Transport.UDP && transport != Transport.TCP)
{
throw new IllegalArgumentException(
@ -91,60 +95,68 @@ public class HostCandidateHarvester
{
InetAddress addr = addresses.nextElement();
IceSocketWrapper sock = null;
try
if((addr instanceof Inet4Address) || !isIPv6Disabled)
{
if(transport == Transport.UDP)
IceSocketWrapper sock = null;
try
{
sock = createDatagramSocket(
addr, preferredPort, minPort, maxPort);
boundAtLeastOneSocket = true;
if(transport == Transport.UDP)
{
sock = createDatagramSocket(
addr, preferredPort, minPort, maxPort);
boundAtLeastOneSocket = true;
}
else if(transport == Transport.TCP)
{
if(addr instanceof Inet6Address)
continue;
sock = createServerSocket(
addr,
preferredPort,
minPort,
maxPort,
component);
boundAtLeastOneSocket = true;
}
}
else if(transport == Transport.TCP)
catch(IOException exc)
{
if(addr instanceof Inet6Address)
continue;
sock = createServerSocket(addr, preferredPort, minPort,
maxPort, component);
boundAtLeastOneSocket = true;
// There seems to be a problem with this particular
// address let's just move on for now and hope we will
// find better
if (logger.isLoggable(Level.WARNING))
{
logger.warning(
"Failed to create a socket for:"
+"\naddr:" + addr
+"\npreferredPort:" + preferredPort
+"\nminPort:" + minPort
+"\nmaxPort:" + maxPort
+"\nprotocol:" + transport
+"\nContinuing with next address");
}
continue;
}
}
catch(IOException exc)
{
//there seems to be a problem with this particular address
//let's just move on for now and hope we will find better
if (logger.isLoggable(Level.WARNING))
HostCandidate candidate
= new HostCandidate(sock, component, transport);
candidate.setVirtual(
NetworkUtils.isInterfaceVirtual(iface));
component.addLocalCandidate(candidate);
if(transport == Transport.TCP)
{
logger.warning(
"Failed to create a socket for:"
+"\naddr:" + addr
+"\npreferredPort:" + preferredPort
+"\nminPort:" + minPort
+"\nmaxPort:" + maxPort
+"\nprotocol:" + transport
+"\nContinuing with next address");
// have to wait a client connection to add a STUN socket
// to the StunStack
continue;
}
continue;
// We are most certainly going to use all local host
// candidates for sending and receiving STUN connectivity
// checks. In case we have enabled STUN, we are going to use
// them as well while harvesting reflexive candidates.
createAndRegisterStunSocket(candidate);
}
HostCandidate candidate = new HostCandidate(sock, component,
transport);
candidate.setVirtual(NetworkUtils.isInterfaceVirtual(iface));
component.addLocalCandidate(candidate);
if(transport == Transport.TCP)
{
/* have to wait a client connection to add a STUN socket
* to the StunStack
*/
continue;
}
//We are most certainly going to use all local host candidates
//for sending and receiving STUN connectivity checks. In case
//we have enabled STUN, we are going to use them as well while
//harvesting reflexive candidates.
createAndRegisterStunSocket(candidate);
}
}

View File

@ -439,7 +439,7 @@ public class MultiplexingDatagramSocket
synchronized (receiveSyncRoot)
{
inReceive = false;
receiveSyncRoot.notifyAll();
receiveSyncRoot.notify();
}
}
}

View File

@ -379,7 +379,7 @@ public class MultiplexingSocket
synchronized (receiveSyncRoot)
{
inReceive = false;
receiveSyncRoot.notifyAll();
receiveSyncRoot.notify();
}
}
}