From 231a3bf147315a9284140476d2b09e13c3fee1c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 May 2012 01:45:49 +0100 Subject: 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. --- .../CoreModules/World/Land/LandManagementModule.cs | 33 +++++++++++++--------- .../CoreModules/World/Media/Moap/MoapModule.cs | 8 ++++-- .../CoreModules/World/WorldMap/WorldMapModule.cs | 17 +++++------ 3 files changed, 34 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index f6d4b40..8b7406d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -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) { diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 5239f50..601e81e 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -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())); } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index faaf928..2335bea 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -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())); } /// -- cgit v1.1