aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 44aee02..03e8852 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -434,9 +434,11 @@ namespace OpenSim.Framework
434 } 434 }
435 435
436 436
437 public static bool checkServiceURI(string uristr, out string serviceURI) 437 public static bool checkServiceURI(string uristr, out string serviceURI, out string serviceHost, out string serviceIPstr)
438 { 438 {
439 serviceURI = string.Empty; 439 serviceURI = string.Empty;
440 serviceHost = string.Empty;
441 serviceIPstr = string.Empty;
440 try 442 try
441 { 443 {
442 Uri uri = new Uri(uristr); 444 Uri uri = new Uri(uristr);
@@ -445,6 +447,13 @@ namespace OpenSim.Framework
445 serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":80/"; 447 serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":80/";
446 else if(uri.Port == 443) 448 else if(uri.Port == 443)
447 serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":443/"; 449 serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":443/";
450 serviceHost = uri.Host;
451
452 IPEndPoint ep = Util.getEndPoint(serviceHost,uri.Port);
453 if(ep == null)
454 return false;
455
456 serviceIPstr = ep.Address.ToString();
448 return true; 457 return true;
449 } 458 }
450 catch 459 catch
@@ -454,9 +463,10 @@ namespace OpenSim.Framework
454 return false; 463 return false;
455 } 464 }
456 465
457 public static bool buildHGRegionURI(string inputName, out string serverURI, out string regionName) 466 public static bool buildHGRegionURI(string inputName, out string serverURI, out string serverHost, out string regionName)
458 { 467 {
459 serverURI = string.Empty; 468 serverURI = string.Empty;
469 serverHost = string.Empty;
460 regionName = string.Empty; 470 regionName = string.Empty;
461 471
462 inputName = inputName.Trim(); 472 inputName = inputName.Trim();
@@ -565,6 +575,7 @@ namespace OpenSim.Framework
565 serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; 575 serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/";
566 else if(uri.Port == 443) 576 else if(uri.Port == 443)
567 serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; 577 serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/";
578 serverHost = uri.Host;
568 return true; 579 return true;
569 } 580 }
570 581