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:
Justin Clark-Casey (justincc)
2012-05-03 01:45:49 +01:00
parent 40f3c24562
commit 231a3bf147
38 changed files with 375 additions and 217 deletions

View File

@@ -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)
{

View File

@@ -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()));
}
}

View File

@@ -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>