Forgot to check in prebuild.xml on sat, see someone already did :)

Fix in DNS resolve
afrisby
Tedd Hansen 2007-09-17 08:06:20 +00:00
parent df58154781
commit 8792645e0d
1 changed files with 10 additions and 2 deletions

View File

@ -61,8 +61,16 @@ namespace OpenSim.Framework.Types
// Old one defaults to IPv6 // Old one defaults to IPv6
//return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port );
// New method favors IPv4
IPAddress ia = null; IPAddress ia = null;
// If it is already an IP, don't resolve it - just return directly
if (IPAddress.TryParse(m_externalHostName, out ia))
return new IPEndPoint(ia, m_internalEndPoint.Port);
// Reset for next check
ia = null;
// New method favors IPv4
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{ {
if (ia == null) if (ia == null)
@ -188,7 +196,7 @@ namespace OpenSim.Framework.Types
{ {
errorMessage = "needs an IP Address (IPAddress)"; errorMessage = "needs an IP Address (IPAddress)";
} }
this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port",(int) 9000); this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", (int)9000);
string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
if (externalHost != "SYSTEMIP") if (externalHost != "SYSTEMIP")