aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces
diff options
context:
space:
mode:
authorUbitUmarov2017-05-25 09:46:29 +0100
committerUbitUmarov2017-05-25 09:46:29 +0100
commit31b4a3124692a2b73a42bb994a61012d747b830c (patch)
tree9753d4a67655fa776de4b55894622d957b97d83d /OpenSim/Services/Interfaces
parentmove assetsconnector threads to whatchdog; Abort all alive threads known to w... (diff)
downloadopensim-SC_OLD-31b4a3124692a2b73a42bb994a61012d747b830c.zip
opensim-SC_OLD-31b4a3124692a2b73a42bb994a61012d747b830c.tar.gz
opensim-SC_OLD-31b4a3124692a2b73a42bb994a61012d747b830c.tar.bz2
opensim-SC_OLD-31b4a3124692a2b73a42bb994a61012d747b830c.tar.xz
add some checks for valid endpoints
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs40
1 files changed, 10 insertions, 30 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 66e5870..8068ff5 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -271,31 +271,6 @@ namespace OpenSim.Services.Interfaces
271 m_serverURI = string.Empty; 271 m_serverURI = string.Empty;
272 } 272 }
273 273
274 /*
275 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
276 {
277 m_regionLocX = regionLocX;
278 m_regionLocY = regionLocY;
279 RegionSizeX = (int)Constants.RegionSize;
280 RegionSizeY = (int)Constants.RegionSize;
281
282 m_internalEndPoint = internalEndPoint;
283 m_externalHostName = externalUri;
284 }
285
286 public GridRegion(int regionLocX, int regionLocY, string externalUri, uint port)
287 {
288 m_regionLocX = regionLocX;
289 m_regionLocY = regionLocY;
290 RegionSizeX = (int)Constants.RegionSize;
291 RegionSizeY = (int)Constants.RegionSize;
292
293 m_externalHostName = externalUri;
294
295 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
296 }
297 */
298
299 public GridRegion(uint xcell, uint ycell) 274 public GridRegion(uint xcell, uint ycell)
300 { 275 {
301 m_regionLocX = (int)Util.RegionToWorldLoc(xcell); 276 m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
@@ -489,14 +464,16 @@ namespace OpenSim.Services.Interfaces
489 { 464 {
490 get 465 get
491 { 466 {
492 // Old one defaults to IPv6
493 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
494
495 IPAddress ia = null; 467 IPAddress ia = null;
496 // If it is already an IP, don't resolve it - just return directly 468 // If it is already an IP, don't resolve it - just return directly
469 // we should not need this
497 if (IPAddress.TryParse(m_externalHostName, out ia)) 470 if (IPAddress.TryParse(m_externalHostName, out ia))
471 {
472 if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any))
473 return null;
498 return new IPEndPoint(ia, m_internalEndPoint.Port); 474 return new IPEndPoint(ia, m_internalEndPoint.Port);
499 475 }
476
500 // Reset for next check 477 // Reset for next check
501 ia = null; 478 ia = null;
502 try 479 try
@@ -513,7 +490,7 @@ namespace OpenSim.Services.Interfaces
513 } 490 }
514 } 491 }
515 } 492 }
516 catch (SocketException e) 493 catch // (SocketException e)
517 { 494 {
518 /*throw new Exception( 495 /*throw new Exception(
519 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + 496 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
@@ -524,6 +501,9 @@ namespace OpenSim.Services.Interfaces
524 return null; 501 return null;
525 } 502 }
526 503
504 if(ia == null)
505 return null;
506
527 return new IPEndPoint(ia, m_internalEndPoint.Port); 507 return new IPEndPoint(ia, m_internalEndPoint.Port);
528 } 508 }
529 } 509 }