simplify a bit some caps paths

0.9.1.0-post-fixes
UbitUmarov 2018-11-14 16:23:14 +00:00
parent 942fd5e653
commit b48cbcbfdd
4 changed files with 14 additions and 16 deletions

View File

@ -350,17 +350,18 @@ namespace OpenSim.Region.ClientStack.Linden
public string SeedCapRequest(string request, string path, string param, public string SeedCapRequest(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
UUID agentID = m_HostCapsObj.AgentID;
m_log.DebugFormat( m_log.DebugFormat(
"[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID); "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, agentID);
if (!m_HostCapsObj.WaitForActivation()) if (!m_HostCapsObj.WaitForActivation())
return string.Empty; return string.Empty;
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint)) if (!m_Scene.CheckClient(agentID, httpRequest.RemoteIPEndPoint))
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[CAPS]: Unauthorized CAPS client {0} from {1}", "[CAPS]: Unauthorized CAPS client {0} from {1}",
m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint); agentID, httpRequest.RemoteIPEndPoint);
return string.Empty; return string.Empty;
} }

View File

@ -93,7 +93,7 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
UUID capuuid = UUID.Random(); string capUrl = "/CAPS/" + UUID.Random() + "/";
// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); // m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
@ -101,7 +101,7 @@ namespace OpenSim.Region.ClientStack.Linden
"ObjectAdd", "ObjectAdd",
new RestHTTPHandler( new RestHTTPHandler(
"POST", "POST",
"/CAPS/OA/" + capuuid + "/", capUrl,
httpMethod => ProcessAdd(httpMethod, agentID, caps), httpMethod => ProcessAdd(httpMethod, agentID, caps),
"ObjectAdd", "ObjectAdd",
agentID.ToString())); ; agentID.ToString())); ;

View File

@ -103,14 +103,14 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
UUID capID = UUID.Random(); string capUrl = "/CAPS/" + UUID.Random() + "/";
// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID); // m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
caps.RegisterHandler( caps.RegisterHandler(
"UploadObjectAsset", "UploadObjectAsset",
new RestHTTPHandler( new RestHTTPHandler(
"POST", "POST",
"/CAPS/OA/" + capID + "/", capUrl,
httpMethod => ProcessAdd(httpMethod, agentID, caps), httpMethod => ProcessAdd(httpMethod, agentID, caps),
"UploadObjectAsset", "UploadObjectAsset",
agentID.ToString())); agentID.ToString()));

View File

@ -51,10 +51,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
private Scene m_scene = null; private Scene m_scene = null;
private UUID regionID = UUID.Zero; private UUID regionID = UUID.Zero;
private static bool Enabled = false; private bool Enabled = false;
private static readonly string capsName = "EnvironmentSettings";
private static readonly string capsBase = "/CAPS/0020/";
#region INonSharedRegionModule #region INonSharedRegionModule
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
@ -133,17 +130,17 @@ namespace OpenSim.Region.CoreModules.World.LightShare
// m_log.DebugFormat("[{0}]: Register capability for agentID {1} in region {2}", // m_log.DebugFormat("[{0}]: Register capability for agentID {1} in region {2}",
// Name, agentID, caps.RegionName); // Name, agentID, caps.RegionName);
string capsPath = capsBase + UUID.Random(); string capsPath = "/CAPS/" + UUID.Random();
// Get handler // Get handler
caps.RegisterHandler( caps.RegisterHandler(
capsName, "EnvironmentSettings",
new RestStreamHandler( new RestStreamHandler(
"GET", "GET",
capsPath, capsPath,
(request, path, param, httpRequest, httpResponse) (request, path, param, httpRequest, httpResponse)
=> GetEnvironmentSettings(request, path, param, agentID, caps), => GetEnvironmentSettings(request, path, param, agentID, caps),
capsName, "EnvironmentSettings",
agentID.ToString())); agentID.ToString()));
// Set handler // Set handler
@ -153,7 +150,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
capsPath, capsPath,
(request, path, param, httpRequest, httpResponse) (request, path, param, httpRequest, httpResponse)
=> SetEnvironmentSettings(request, path, param, agentID, caps), => SetEnvironmentSettings(request, path, param, agentID, caps),
capsName, "EnvironmentSettings",
agentID.ToString())); agentID.ToString()));
} }
#endregion #endregion