Commit f2a95704 authored by Guus der Kinderen's avatar Guus der Kinderen Committed by akrherz

OF-1301: Don't fail on default FQDN calculation. (#760)

parent 07534897
......@@ -61,17 +61,23 @@ public class XMPPServerInfoImpl implements XMPPServerInfo {
@Override
public String getHostname()
{
{
final String fqdn = JiveGlobals.getProperty( "xmpp.fqdn" );
if ( fqdn != null && !fqdn.trim().isEmpty() )
{
return fqdn.trim().toLowerCase();
}
try
{
return JiveGlobals.getProperty( "xmpp.fqdn", InetAddress.getLocalHost().getCanonicalHostName() ).toLowerCase();
return InetAddress.getLocalHost().getCanonicalHostName().toLowerCase();
}
catch (UnknownHostException ex)
{
Log.warn( "Unable to determine local hostname.", ex );
return "localhost";
}
}
}
@Override
public void setHostname( String fqdn )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment