diff options
author | UbitUmarov | 2017-05-29 03:13:56 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-29 03:13:56 +0100 |
commit | 27afe136d4ef1cf700802cc4d719156f0445f2b4 (patch) | |
tree | 3eab200c46638084f3e121d04d4f37fa01f7ad12 | |
parent | cleanup util.cs get dns (diff) | |
download | opensim-SC_OLD-27afe136d4ef1cf700802cc4d719156f0445f2b4.zip opensim-SC_OLD-27afe136d4ef1cf700802cc4d719156f0445f2b4.tar.gz opensim-SC_OLD-27afe136d4ef1cf700802cc4d719156f0445f2b4.tar.bz2 opensim-SC_OLD-27afe136d4ef1cf700802cc4d719156f0445f2b4.tar.xz |
mono is a total crap
3 files changed, 30 insertions, 26 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e3d89dc..3ddeafb 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1064,6 +1064,9 @@ namespace OpenSim.Framework | |||
1064 | 1064 | ||
1065 | public static IPEndPoint getEndPoint(string hostname, int port) | 1065 | public static IPEndPoint getEndPoint(string hostname, int port) |
1066 | { | 1066 | { |
1067 | if(String.IsNullOrWhiteSpace(hostname)) | ||
1068 | return null; | ||
1069 | |||
1067 | IPAddress ia = null; | 1070 | IPAddress ia = null; |
1068 | // If it is already an IP, avoid possible broken mono from seeing it | 1071 | // If it is already an IP, avoid possible broken mono from seeing it |
1069 | if (IPAddress.TryParse(hostname, out ia) && ia != null) | 1072 | if (IPAddress.TryParse(hostname, out ia) && ia != null) |
@@ -1075,31 +1078,31 @@ namespace OpenSim.Framework | |||
1075 | 1078 | ||
1076 | // Reset for next check | 1079 | // Reset for next check |
1077 | ia = null; | 1080 | ia = null; |
1078 | try | 1081 | #if (_MONO) |
1082 | // mono is a TOTAL CRAP | ||
1083 | int retry = 3; | ||
1084 | while(ia == null && retry-- >= 0) | ||
1085 | #endif | ||
1079 | { | 1086 | { |
1080 | foreach (IPAddress Adr in Dns.GetHostAddresses(hostname)) | 1087 | try |
1081 | { | 1088 | { |
1082 | if (ia == null) | 1089 | foreach (IPAddress Adr in Dns.GetHostAddresses(hostname)) |
1083 | ia = Adr; | ||
1084 | |||
1085 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
1086 | { | 1090 | { |
1087 | ia = Adr; | 1091 | if (ia == null) |
1088 | break; | 1092 | ia = Adr; |
1093 | |||
1094 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
1095 | { | ||
1096 | ia = Adr; | ||
1097 | break; | ||
1098 | } | ||
1089 | } | 1099 | } |
1090 | } | 1100 | } |
1101 | catch // (SocketException e) | ||
1102 | { | ||
1103 | ia = null; | ||
1104 | } | ||
1091 | } | 1105 | } |
1092 | catch // (SocketException e) | ||
1093 | { | ||
1094 | /*throw new Exception( | ||
1095 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + | ||
1096 | e + "' attached to this exception", e);*/ | ||
1097 | // Don't throw a fatal exception here, instead, return Null and handle it in the caller. | ||
1098 | // Reason is, on systems such as OSgrid it has occured that known hostnames stop | ||
1099 | // resolving and thus make surrounding regions crash out with this exception. | ||
1100 | return null; | ||
1101 | } | ||
1102 | |||
1103 | return getEndPoint(ia,port); | 1106 | return getEndPoint(ia,port); |
1104 | } | 1107 | } |
1105 | 1108 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 5054326..1feece1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -512,11 +512,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
512 | if (DebugLevel > 0) | 512 | if (DebugLevel > 0) |
513 | m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}", | 513 | m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}", |
514 | LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY); | 514 | LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY); |
515 | //debug | ||
516 | if(endPoint == null) | ||
517 | m_log.DebugFormat("EnableSimulator null endpoint"); | ||
518 | if(endPoint.Address == null) | ||
519 | m_log.DebugFormat("EnableSimulator null endpoint address"); | ||
520 | 515 | ||
521 | OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); | 516 | OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); |
522 | Enqueue(item, avatarID); | 517 | Enqueue(item, avatarID); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b6e9a65..0505e58 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -2157,6 +2157,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2157 | { | 2157 | { |
2158 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start | 2158 | Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start |
2159 | int count = 0; | 2159 | int count = 0; |
2160 | IPEndPoint ipe; | ||
2160 | 2161 | ||
2161 | foreach (GridRegion neighbour in neighbours) | 2162 | foreach (GridRegion neighbour in neighbours) |
2162 | { | 2163 | { |
@@ -2165,8 +2166,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2165 | { | 2166 | { |
2166 | if (newneighbours.Contains(handler)) | 2167 | if (newneighbours.Contains(handler)) |
2167 | { | 2168 | { |
2168 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, | 2169 | ipe = neighbour.ExternalEndPoint; |
2169 | neighbour.ExternalEndPoint, true); | 2170 | if (ipe != null) |
2171 | InformClientOfNeighbourAsync(sp, cagents[count], neighbour, ipe, true); | ||
2172 | else | ||
2173 | { | ||
2174 | m_log.Debug("[ENTITY TRANSFER MODULE]: DNS for neighbour lost"); | ||
2175 | } | ||
2170 | count++; | 2176 | count++; |
2171 | } | 2177 | } |
2172 | else if (!previousRegionNeighbourHandles.Contains(handler)) | 2178 | else if (!previousRegionNeighbourHandles.Contains(handler)) |