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 public static final String NOMINATION_TIMER
= "org.ice4j.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 * Returns the String value of the specified property (minus all
* encompassing whitespaces)and null in case no property value was mapped * encompassing whitespaces)and null in case no property value was mapped
@ -190,4 +195,34 @@ public class StackProperties
} }
return intValue; 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

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

View File

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

View File

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

View File

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