1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +01:00

SMACK-283 Changed the STUNResolver to not use a default server. Thus causing it to fail to initialize if no server is actually configured.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12106 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2011-03-14 01:04:40 +00:00
parent f21ae88344
commit 67a5e6b98d

View file

@ -52,11 +52,6 @@ public class STUNResolver extends TransportResolver {
// The filename where the STUN servers are stored.
public final static String STUNSERVERS_FILENAME = "META-INF/stun-config.xml";
// Fallback values when we don't have any STUN server to use...
private final static String FALLBACKHOSTNAME = "stun.xten.net";
private final static int FALLBACKHOSTPORT = 3478;
// Current STUN server we are using
protected STUNService currentServer;
@ -189,10 +184,10 @@ public class STUNResolver extends TransportResolver {
}
catch (XmlPullParserException e) {
e.printStackTrace();
LOGGER.error(e.getMessage(), e);
}
catch (IOException e) {
e.printStackTrace();
LOGGER.error(e.getMessage(), e);
}
currentServer = bestSTUNServer(serversList);
@ -247,13 +242,7 @@ public class STUNResolver extends TransportResolver {
}
}
catch (Exception e) {
e.printStackTrace();
}
// If the list of candidates is empty, add at least one default server
if (serversList.isEmpty()) {
currentServer = new STUNService(FALLBACKHOSTNAME, FALLBACKHOSTPORT);
serversList.add(currentServer);
LOGGER.error(e.getMessage(), e);
}
return serversList;
@ -370,14 +359,14 @@ public class STUNResolver extends TransportResolver {
}
}
catch (Exception e) {
e.printStackTrace();
LOGGER.error(e.getMessage(), e);
}
}
}
}
}
catch (SocketException e) {
e.printStackTrace();
LOGGER.error(e.getMessage(), e);
}
finally {
setInitialized();
@ -524,7 +513,7 @@ public class STUNResolver extends TransportResolver {
}
}
catch (Exception e) {
e.printStackTrace();
LOGGER.error(e.getMessage(), e);
}
return result;