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) public static IPEndPoint getEndPoint(string hostname, int port)
{ {
if(String.IsNullOrWhiteSpace(hostname))
return null;
IPAddress ia = null; IPAddress ia = null;
// If it is already an IP, avoid possible broken mono from seeing it // If it is already an IP, avoid possible broken mono from seeing it
if (IPAddress.TryParse(hostname, out ia) && ia != null) if (IPAddress.TryParse(hostname, out ia) && ia != null)
@ -1075,6 +1078,12 @@ namespace OpenSim.Framework
// Reset for next check // Reset for next check
ia = null; ia = null;
#if (_MONO)
// mono is a TOTAL CRAP
int retry = 3;
while(ia == null && retry-- >= 0)
#endif
{
try try
{ {
foreach (IPAddress Adr in Dns.GetHostAddresses(hostname)) foreach (IPAddress Adr in Dns.GetHostAddresses(hostname))
@ -1091,15 +1100,9 @@ namespace OpenSim.Framework
} }
catch // (SocketException e) catch // (SocketException e)
{ {
/*throw new Exception( ia = null;
"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;
} }
return getEndPoint(ia,port); return getEndPoint(ia,port);
} }

View File

@ -512,11 +512,6 @@ namespace OpenSim.Region.ClientStack.Linden
if (DebugLevel > 0) if (DebugLevel > 0)
m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}", m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}",
LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY); 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); OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY);
Enqueue(item, avatarID); 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 Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
int count = 0; int count = 0;
IPEndPoint ipe;
foreach (GridRegion neighbour in neighbours) foreach (GridRegion neighbour in neighbours)
{ {
@ -2165,8 +2166,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{ {
if (newneighbours.Contains(handler)) if (newneighbours.Contains(handler))
{ {
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, ipe = neighbour.ExternalEndPoint;
neighbour.ExternalEndPoint, true); if (ipe != null)
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, ipe, true);
else
{
m_log.Debug("[ENTITY TRANSFER MODULE]: DNS for neighbour lost");
}
count++; count++;
} }
else if (!previousRegionNeighbourHandles.Contains(handler)) else if (!previousRegionNeighbourHandles.Contains(handler))