From eedb0a1c85e829102a2e097e634979bbced89939 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 2 Sep 2019 22:56:57 +0100 Subject: [PATCH] missing file --- OpenSim/Framework/Util.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 44aee02ab8..03e885239f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -434,9 +434,11 @@ namespace OpenSim.Framework } - public static bool checkServiceURI(string uristr, out string serviceURI) + public static bool checkServiceURI(string uristr, out string serviceURI, out string serviceHost, out string serviceIPstr) { serviceURI = string.Empty; + serviceHost = string.Empty; + serviceIPstr = string.Empty; try { Uri uri = new Uri(uristr); @@ -445,6 +447,13 @@ namespace OpenSim.Framework serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":80/"; else if(uri.Port == 443) serviceURI = serviceURI.Trim(new char[] { '/', ' ' }) +":443/"; + serviceHost = uri.Host; + + IPEndPoint ep = Util.getEndPoint(serviceHost,uri.Port); + if(ep == null) + return false; + + serviceIPstr = ep.Address.ToString(); return true; } catch @@ -454,9 +463,10 @@ namespace OpenSim.Framework return false; } - public static bool buildHGRegionURI(string inputName, out string serverURI, out string regionName) + public static bool buildHGRegionURI(string inputName, out string serverURI, out string serverHost, out string regionName) { serverURI = string.Empty; + serverHost = string.Empty; regionName = string.Empty; inputName = inputName.Trim(); @@ -565,6 +575,7 @@ namespace OpenSim.Framework serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; else if(uri.Port == 443) serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; + serverHost = uri.Host; return true; }