mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Implement optional name and description on http stream handlers so that we can relate a slow request to what the handler actually does and the agent it serves, if applicable.
This is most useful for capabilities where the url is not self-describing.
This commit is contained in:
@@ -1433,21 +1433,26 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
string capsBase = "/CAPS/" + caps.CapsObjectPath;
|
||||
caps.RegisterHandler("RemoteParcelRequest",
|
||||
new RestStreamHandler("POST", capsBase + remoteParcelRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return RemoteParcelRequest(request, path, param, agentID, caps);
|
||||
}));
|
||||
caps.RegisterHandler(
|
||||
"RemoteParcelRequest",
|
||||
new RestStreamHandler(
|
||||
"POST",
|
||||
capsBase + remoteParcelRequestPath,
|
||||
(request, path, param, httpRequest, httpResponse)
|
||||
=> RemoteParcelRequest(request, path, param, agentID, caps),
|
||||
"RemoteParcelRequest",
|
||||
agentID.ToString()));
|
||||
|
||||
UUID parcelCapID = UUID.Random();
|
||||
caps.RegisterHandler("ParcelPropertiesUpdate",
|
||||
new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
|
||||
delegate(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ProcessPropertiesUpdate(request, path, param, agentID, caps);
|
||||
}));
|
||||
caps.RegisterHandler(
|
||||
"ParcelPropertiesUpdate",
|
||||
new RestStreamHandler(
|
||||
"POST",
|
||||
"/CAPS/" + parcelCapID,
|
||||
(request, path, param, httpRequest, httpResponse)
|
||||
=> ProcessPropertiesUpdate(request, path, param, agentID, caps),
|
||||
"ParcelPropertiesUpdate",
|
||||
agentID.ToString()));
|
||||
}
|
||||
private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
|
||||
{
|
||||
|
||||
@@ -145,7 +145,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||
|
||||
// Even though we're registering for POST we're going to get GETS and UPDATES too
|
||||
caps.RegisterHandler(
|
||||
"ObjectMedia", new RestStreamHandler("POST", omCapUrl, HandleObjectMediaMessage));
|
||||
"ObjectMedia",
|
||||
new RestStreamHandler(
|
||||
"POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString()));
|
||||
}
|
||||
|
||||
string omuCapUrl = "/CAPS/" + UUID.Random();
|
||||
@@ -157,7 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||
|
||||
// Even though we're registering for POST we're going to get GETS and UPDATES too
|
||||
caps.RegisterHandler(
|
||||
"ObjectMediaNavigate", new RestStreamHandler("POST", omuCapUrl, HandleObjectMediaNavigateMessage));
|
||||
"ObjectMediaNavigate",
|
||||
new RestStreamHandler(
|
||||
"POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,14 +190,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
//m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
|
||||
string capsBase = "/CAPS/" + caps.CapsObjectPath;
|
||||
caps.RegisterHandler("MapLayer",
|
||||
new RestStreamHandler("POST", capsBase + m_mapLayerPath,
|
||||
delegate(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return MapLayerRequest(request, path, param,
|
||||
agentID, caps);
|
||||
}));
|
||||
caps.RegisterHandler(
|
||||
"MapLayer",
|
||||
new RestStreamHandler(
|
||||
"POST",
|
||||
capsBase + m_mapLayerPath,
|
||||
(request, path, param, httpRequest, httpResponse)
|
||||
=> MapLayerRequest(request, path, param, agentID, caps),
|
||||
"MapLayer",
|
||||
agentID.ToString()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user