aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2008-10-14 09:51:21 +0000
committerEmil Ivov <emcho@jitsi.org>2008-10-14 09:51:21 +0000
commit232eca98bbba968ea8fb7d22cce35b2cb624176b (patch)
tree52dce0e0351dbcbc654d0b4686959d55587a7dde /src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
parentd4d1563eed0f855f6b46b6fbbce25d35003e3db3 (diff)
downloadjitsi-232eca98bbba968ea8fb7d22cce35b2cb624176b.zip
jitsi-232eca98bbba968ea8fb7d22cce35b2cb624176b.tar.gz
jitsi-232eca98bbba968ea8fb7d22cce35b2cb624176b.tar.bz2
Adding extra logging to help diagnoze wrong localhost selections.
Diffstat (limited to 'src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java')
-rw-r--r--src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java b/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
index be131d5..0e114a2 100644
--- a/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
@@ -237,11 +237,17 @@ public class NetworkAddressManagerServiceImpl
*/
public synchronized InetAddress getLocalHost(InetAddress intendedDestination)
{
+ if(logger.isTraceEnabled())
+ {
+ logger.trace("Querying a localhost addr for dst="
+ + intendedDestination);
+
+ }
//no point in making sure that the localHostFinderSocket is initialized.
//better let it through a NullPointerException.
InetAddress localHost = null;
localHostFinderSocket.connect(intendedDestination
- , this.RANDOM_ADDR_DISC_PORT);
+ , RANDOM_ADDR_DISC_PORT);
localHost = localHostFinderSocket.getLocalAddress();
localHostFinderSocket.disconnect();
//windows socket implementations return the any address so we need to
@@ -249,6 +255,8 @@ public class NetworkAddressManagerServiceImpl
//better on windows so lets hope it'll do the trick.
if( localHost.isAnyLocalAddress())
{
+ logger.trace("Socket returned the AnyLocalAddress. "+
+ "Trying a workaround.");
try
{
//all that's inside the if is an ugly IPv6 hack
@@ -276,6 +284,11 @@ public class NetworkAddressManagerServiceImpl
&& !address.isSiteLocalAddress()
&& !address.isLoopbackAddress())
{
+ if(logger.isTraceEnabled())
+ {
+ logger.trace("will return ipv6 addr "
+ + address);
+ }
return address;
}
}
@@ -293,6 +306,11 @@ public class NetworkAddressManagerServiceImpl
}
}
+ if(logger.isTraceEnabled())
+ {
+ logger.trace("Will return the following localhost address"
+ + localHost);
+ }
return localHost;
}