Returns immediately if checks have already been done.

This commit is contained in:
Boris Grozev 2015-11-08 10:05:18 -06:00
parent 3a49e56475
commit 7a8b7ec2c3

View File

@ -111,8 +111,9 @@ public class StunMappingCandidateHarvester
*/ */
private static synchronized boolean obtainAddresses() private static synchronized boolean obtainAddresses()
{ {
if(mask != null && face != null) if (addressChecked)
return true; return;
addressChecked = true;
try try
{ {
@ -155,7 +156,6 @@ public class StunMappingCandidateHarvester
logger.info("Detected through stun local IP: " + face); logger.info("Detected through stun local IP: " + face);
logger.info("Detected through stun public IP: " + mask); logger.info("Detected through stun public IP: " + mask);
addressChecked = true;
} }
catch (Exception exc) catch (Exception exc)
{ {