mono is a total crap

0.9.0-post-fixes
UbitUmarov 2017-05-29 03:13:56 +01:00
parent 2c19d08448
commit 27afe136d4
3 changed files with 30 additions and 26 deletions

View File

@ -1064,6 +1064,9 @@ namespace OpenSim.Framework
public static IPEndPoint getEndPoint(string hostname, int port)
{
if(String.IsNullOrWhiteSpace(hostname))
return null;
IPAddress ia = null;
// If it is already an IP, avoid possible broken mono from seeing it
if (IPAddress.TryParse(hostname, out ia) && ia != null)
@ -1075,6 +1078,12 @@ namespace OpenSim.Framework
// Reset for next check
ia = null;
#if (_MONO)
// mono is a TOTAL CRAP
int retry = 3;
while(ia == null && retry-- >= 0)
#endif
{
try
{
foreach (IPAddress Adr in Dns.GetHostAddresses(hostname))
@ -1091,15 +1100,9 @@ namespace OpenSim.Framework
}
catch // (SocketException e)
{
/*throw new Exception(
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
e + "' attached to this exception", e);*/
// Don't throw a fatal exception here, instead, return Null and handle it in the caller.
// Reason is, on systems such as OSgrid it has occured that known hostnames stop
// resolving and thus make surrounding regions crash out with this exception.
return null;
ia = null;
}
}
return getEndPoint(ia,port);
}

View File

@ -512,11 +512,6 @@ namespace OpenSim.Region.ClientStack.Linden
if (DebugLevel > 0)
m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}",
LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY);
//debug
if(endPoint == null)
m_log.DebugFormat("EnableSimulator null endpoint");
if(endPoint.Address == null)
m_log.DebugFormat("EnableSimulator null endpoint address");
OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY);
Enqueue(item, avatarID);

View File

@ -2157,6 +2157,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
int count = 0;
IPEndPoint ipe;
foreach (GridRegion neighbour in neighbours)
{
@ -2165,8 +2166,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
if (newneighbours.Contains(handler))
{
InformClientOfNeighbourAsync(sp, cagents[count], neighbour,
neighbour.ExternalEndPoint, true);
ipe = neighbour.ExternalEndPoint;
if (ipe != null)
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, ipe, true);
else
{
m_log.Debug("[ENTITY TRANSFER MODULE]: DNS for neighbour lost");
}
count++;
}
else if (!previousRegionNeighbourHandles.Contains(handler))