From 8f34e46d7449be1c29419a232a8f7f1e5918f03c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Oct 2010 23:35:01 +0100 Subject: Revert "* refactor refactor refactor ServerURI 4 lyfe" This reverts commit 55974df14b6d64c1e1f9e386a3eacce3ba86dc98. --- OpenSim/Framework/RegionInfo.cs | 8 +--- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 10 ++--- OpenSim/Region/Application/OpenSimBase.cs | 2 +- .../EntityTransfer/EntityTransferModule.cs | 27 +++++++++---- .../CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- .../Hypergrid/GatekeeperServiceConnector.cs | 31 ++++++--------- .../Connectors/Land/LandServiceConnector.cs | 3 +- .../Neighbour/NeighbourServiceConnector.cs | 2 +- .../SimianGrid/SimianGridServiceConnector.cs | 4 +- .../Simulation/SimulationServiceConnector.cs | 45 +++++++++++++++++++--- OpenSim/Services/GridService/HypergridLinker.cs | 14 +------ .../Services/HypergridService/GatekeeperService.cs | 2 +- .../Services/HypergridService/UserAgentService.cs | 8 ++-- OpenSim/Services/Interfaces/IGridService.cs | 8 +--- 14 files changed, 94 insertions(+), 72 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 949a289..08d5398 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -116,13 +116,7 @@ namespace OpenSim.Framework public string ServerURI { get { return m_serverURI; } - set { - if ( value.EndsWith("/") ) { - m_serverURI = value; - } else { - m_serverURI = value + '/'; - } - } + set { m_serverURI = value; } } protected string m_serverURI; diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 47e86ad..ba8c194 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -348,7 +348,7 @@ namespace OpenSim.Framework.Servers.HttpServer { try { - m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); +// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); @@ -376,11 +376,11 @@ namespace OpenSim.Framework.Servers.HttpServer string path = request.RawUrl; string handlerKey = GetHandlerKey(request.HttpMethod, path); - m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); +// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); if (TryGetStreamHandler(handlerKey, out requestHandler)) { - m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler"); + //m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler"); // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. byte[] buffer = null; @@ -395,7 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer } else if (requestHandler is IGenericHTTPHandler) { - m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); + //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; Stream requestStream = request.InputStream; @@ -422,7 +422,7 @@ namespace OpenSim.Framework.Servers.HttpServer foreach (string headername in rHeaders) { - m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); + //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); headervals[headername] = request.Headers[headername]; } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f30a850..74ad168 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -327,8 +327,8 @@ namespace OpenSim //regionInfo.originRegionID = regionInfo.RegionID; // set initial ServerURI + regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port; regionInfo.HttpPort = m_httpServerPort; - regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString(); regionInfo.osSecret = m_osSecret; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3791e1d..38fff1c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -337,11 +337,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (sp.ClientView.TryGet(out ipepClient)) { capsPath - = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); + = "http://" + + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName) + + ":" + + finalDestination.HttpPort + + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); } else { - capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); + capsPath + = "http://" + + finalDestination.ExternalHostName + + ":" + + finalDestination.HttpPort + + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); } #endregion @@ -373,7 +382,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer else { agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); - capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/"; + capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort + + "/CAPS/" + agentCircuit.CapsPath + "0000/"; } // Expect avatar crossing is a heavy-duty function at the destination. @@ -506,7 +516,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) { - agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; + agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort + + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; } @@ -831,7 +842,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer cAgent.Position = pos; if (isFlying) cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; - cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + + cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) @@ -859,7 +870,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } // TODO Should construct this behind a method string capsPath = - neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; + "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort + + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); @@ -1178,7 +1190,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer y = y / Constants.RegionSize; m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); - string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/"; + string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort + + "/CAPS/" + a.CapsPath + "0000/"; string reason = String.Empty; diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 3ce964a..a182eea 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); regionimage = regionimage.Replace("-", ""); - m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage); + m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage); MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); MainServer.Instance.AddLLSDHandler( diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 89a8f7a..479a80e 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -108,8 +108,8 @@ namespace OpenSim.Services.Connectors.Hypergrid } hash = (Hashtable)response.Value; - foreach (Object o in hash) - m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); + //foreach (Object o in hash) + // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); try { bool success = false; @@ -117,20 +117,16 @@ namespace OpenSim.Services.Connectors.Hypergrid if (success) { UUID.TryParse((string)hash["uuid"], out regionID); - m_log.Debug(">> HERE, uuid: " + regionID); + //m_log.Debug(">> HERE, uuid: " + uuid); if ((string)hash["handle"] != null) { realHandle = Convert.ToUInt64((string)hash["handle"]); - m_log.Debug(">> HERE, realHandle: " + realHandle); + //m_log.Debug(">> HERE, realHandle: " + realHandle); } - if (hash["region_image"] != null) { + if (hash["region_image"] != null) imageURL = (string)hash["region_image"]; - m_log.Debug(">> HERE, imageURL: " + imageURL); - } - if (hash["external_name"] != null) { + if (hash["external_name"] != null) externalName = (string)hash["external_name"]; - m_log.Debug(">> HERE, externalName: " + externalName); - } } } @@ -212,8 +208,8 @@ namespace OpenSim.Services.Connectors.Hypergrid } hash = (Hashtable)response.Value; - foreach (Object o in hash) - m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); + //foreach (Object o in hash) + // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); try { bool success = false; @@ -223,41 +219,38 @@ namespace OpenSim.Services.Connectors.Hypergrid GridRegion region = new GridRegion(); UUID.TryParse((string)hash["uuid"], out region.RegionID); - m_log.Debug(">> HERE, uuid: " + region.RegionID); + //m_log.Debug(">> HERE, uuid: " + region.RegionID); int n = 0; if (hash["x"] != null) { Int32.TryParse((string)hash["x"], out n); region.RegionLocX = n; - m_log.Debug(">> HERE, x: " + region.RegionLocX); + //m_log.Debug(">> HERE, x: " + region.RegionLocX); } if (hash["y"] != null) { Int32.TryParse((string)hash["y"], out n); region.RegionLocY = n; - m_log.Debug(">> HERE, y: " + region.RegionLocY); + //m_log.Debug(">> HERE, y: " + region.RegionLocY); } if (hash["region_name"] != null) { region.RegionName = (string)hash["region_name"]; - m_log.Debug(">> HERE, region_name: " + region.RegionName); + //m_log.Debug(">> HERE, name: " + region.RegionName); } if (hash["hostname"] != null) region.ExternalHostName = (string)hash["hostname"]; - m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); if (hash["http_port"] != null) { uint p = 0; UInt32.TryParse((string)hash["http_port"], out p); region.HttpPort = p; - m_log.Debug(">> HERE, http_port: " + region.HttpPort); } if (hash["internal_port"] != null) { int p = 0; Int32.TryParse((string)hash["internal_port"], out p); region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); - m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); } // Successful return diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 4b25ac8..8143b5a 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -84,7 +84,8 @@ namespace OpenSim.Services.Connectors if (info != null) // just to be sure { XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); - XmlRpcResponse response = request.Send(info.ServerURI, 10000); + string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; + XmlRpcResponse response = request.Send(uri, 10000); if (response.IsFault) { m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString); diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs index 9c57a40..0a982f8 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs @@ -87,7 +87,7 @@ namespace OpenSim.Services.Connectors public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) { - string uri = region.ServerURI + "/region/" + thisRegion.RegionID + "/"; + string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); WebRequest HelloNeighbourRequest = WebRequest.Create(uri); diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 8076fab..168b233 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -145,6 +145,8 @@ namespace OpenSim.Services.Connectors.SimianGrid Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); + string httpAddress = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/"; + OSDMap extraData = new OSDMap { { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, @@ -166,7 +168,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { "Name", regionInfo.RegionName }, { "MinPosition", minPosition.ToString() }, { "MaxPosition", maxPosition.ToString() }, - { "Address", regionInfo.ServerURI }, + { "Address", httpAddress }, { "Enabled", "1" }, { "ExtraData", OSDParser.SerializeJsonString(extraData) } }; diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 07839d3..a5f748f 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -104,7 +104,24 @@ namespace OpenSim.Services.Connectors.Simulation return false; } - string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; + string uri = string.Empty; + + // HACK -- Simian grid make it work!!! + if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) + uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; + else + { + try + { + uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; + } + catch (Exception e) + { + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); + reason = e.Message; + return false; + } + } //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); @@ -260,7 +277,16 @@ namespace OpenSim.Services.Connectors.Simulation private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) { // Eventually, we want to use a caps url instead of the agentID - string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; + string uri = string.Empty; + try + { + uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/"; + } + catch (Exception e) + { + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); + return false; + } //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); @@ -359,7 +385,7 @@ namespace OpenSim.Services.Connectors.Simulation { agent = null; // Eventually, we want to use a caps url instead of the agentID - string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); @@ -453,7 +479,16 @@ namespace OpenSim.Services.Connectors.Simulation public bool CloseAgent(GridRegion destination, UUID id) { - string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + string uri = string.Empty; + try + { + uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + } + catch (Exception e) + { + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message); + return false; + } //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri); @@ -503,7 +538,7 @@ namespace OpenSim.Services.Connectors.Simulation public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) { string uri - = destination.ServerURI + ObjectPath() + sog.UUID + "/"; + = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); WebRequest ObjectCreateRequest = WebRequest.Create(uri); diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 757ae80..b86fb6f 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -127,7 +127,7 @@ namespace OpenSim.Services.GridService if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", - "link-region [] ", + "link-region :[:] ", "Link a hypergrid region", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", "unlink-region or : ", @@ -200,15 +200,9 @@ namespace OpenSim.Services.GridService } - public bool TryCreateLink(UUID scopeID, int xloc, int yloc, - string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) - { - TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, regInfo, reason); - } - // From the command line and the 2 above public bool TryCreateLink(UUID scopeID, int xloc, int yloc, - string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason) + string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) { m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); @@ -515,16 +509,12 @@ namespace OpenSim.Services.GridService int xloc, yloc; uint externalPort; string externalHostName; - string serverURI; try { xloc = Convert.ToInt32(cmdparams[0]); yloc = Convert.ToInt32(cmdparams[1]); externalPort = Convert.ToUInt32(cmdparams[3]); externalHostName = cmdparams[2]; - if ( cmdparams.Length == 4 ) { - - } //internalPort = Convert.ToUInt32(cmdparams[4]); //remotingPort = Convert.ToUInt32(cmdparams[5]); } diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 9e96163..3f5c4f1 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -157,7 +157,7 @@ namespace OpenSim.Services.HypergridService string regionimage = "regionImage" + region.RegionID.ToString(); regionimage = regionimage.Replace("-", ""); - imageURL = region.ServerURI + "index.php?method=" + regionimage; + imageURL = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/index.php?method=" + regionimage; return true; } diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index d5dda11..eb6433c 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -145,12 +145,12 @@ namespace OpenSim.Services.HypergridService region.RegionLocY = finalDestination.RegionLocY; // Generate a new service session - agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); + agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); bool success = false; string myExternalIP = string.Empty; - string gridName = gatekeeper.ServerURI; + string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; if (m_GridName == gridName) success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); else @@ -159,7 +159,7 @@ namespace OpenSim.Services.HypergridService if (!success) { m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", - agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); + agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason); // restore the old travel info lock (m_TravelingAgents) @@ -210,7 +210,7 @@ namespace OpenSim.Services.HypergridService m_TravelingAgents[agentCircuit.SessionID] = travel; } travel.UserID = agentCircuit.AgentID; - travel.GridExternalName = region.ServerURI; + travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; travel.ServiceToken = agentCircuit.ServiceSessionID; if (old != null) travel.ClientIPAddress = old.ClientIPAddress; diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index bf441e6..77230a3 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -116,13 +116,7 @@ namespace OpenSim.Services.Interfaces public string ServerURI { get { return m_serverURI; } - set { - if ( value.EndsWith("/") ) { - m_serverURI = value; - } else { - m_serverURI = value + '/'; - } - } + set { m_serverURI = value; } } protected string m_serverURI; -- cgit v1.1