From e19defde36ddbd5ff90d8304c6fe3b57110f8078 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 8 Jul 2013 22:03:07 +0100 Subject: [PATCH] Add "show caps stats by user" and "show caps stats by cap" console commands to print various counts of capability invocation by user and by cap This currently prints caps requests received and handled, so that overload of received compared to handled or deadlock can be detected. This involves making BaseStreamHandler and BaseOutputStream record the ints, which means inheritors should subclass ProcessRequest() instead of Handle() However, existing inheriting classes overriding Handle() will still work, albeit without stats recording. "show caps" becomes "show caps list" to disambiguate between show caps commands --- .../HGGroupsServiceRobustConnector.cs | 2 +- .../Remote/GroupsServiceRobustConnector.cs | 2 +- .../Remote/OfflineIMServiceRobustConnector.cs | 2 +- OpenSim/Capabilities/CapsHandlers.cs | 16 +- .../AvatarPickerSearchHandler.cs | 2 +- .../Handlers/GetTexture/GetTextureHandler.cs | 2 +- OpenSim/Capabilities/LLSDStreamHandler.cs | 2 +- .../Servers/HttpServer/BaseRequestHandler.cs | 4 + .../Servers/HttpServer/BaseStreamHandler.cs | 27 +- .../Servers/HttpServer/BinaryStreamHandler.cs | 2 +- .../HttpServer/Interfaces/IStreamHandler.cs | 15 +- .../HttpServer/RestDeserialiseHandler.cs | 4 +- .../Servers/HttpServer/RestSessionService.cs | 13 +- .../Servers/HttpServer/RestStreamHandler.cs | 2 +- OpenSim/Region/Application/OpenSimBase.cs | 8 +- .../Linden/Caps/RegionConsoleModule.cs | 2 +- .../Avatar/Friends/FriendsRequestHandler.cs | 2 +- .../Framework/Caps/CapabilitiesModule.cs | 234 +++++++++++++++++- .../World/Estate/XEstateRequestHandler.cs | 2 +- .../Framework/Scenes/RegionStatsHandler.cs | 2 +- .../ViewerSupport/DynamicMenuModule.cs | 2 +- .../WorldView/WorldViewRequestHandler.cs | 2 +- .../Asset/AssetServerDeleteHandler.cs | 2 +- .../Handlers/Asset/AssetServerGetHandler.cs | 2 +- .../Handlers/Asset/AssetServerPostHandler.cs | 2 +- .../AuthenticationServerPostHandler.cs | 2 +- .../Authentication/OpenIdServerHandler.cs | 30 +-- .../AuthorizationServerPostHandler.cs | 2 +- .../Avatar/AvatarServerPostHandler.cs | 2 +- .../Friends/FriendsServerPostHandler.cs | 2 +- .../Handlers/Grid/GridServerPostHandler.cs | 2 +- .../GridUser/GridUserServerPostHandler.cs | 2 +- .../Hypergrid/HGFriendsServerPostHandler.cs | 2 +- .../Handlers/Hypergrid/HeloServerConnector.cs | 2 +- .../Handlers/Hypergrid/HomeAgentHandlers.cs | 1 + .../InventoryServerMoveItemsHandler.cs | 2 +- .../Inventory/XInventoryInConnector.cs | 2 +- .../Handlers/Map/MapAddServerConnector.cs | 2 +- .../Handlers/Map/MapGetServerConnector.cs | 2 +- .../Handlers/Neighbour/NeighbourHandlers.cs | 8 +- .../Presence/PresenceServerPostHandler.cs | 2 +- .../Handlers/Simulation/AgentHandlers.cs | 4 +- .../UserAccountServerPostHandler.cs | 2 +- 43 files changed, 346 insertions(+), 80 deletions(-) diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index 3584f78c52..67750f50e8 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs @@ -113,7 +113,7 @@ namespace OpenSim.Groups m_GroupsService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 28f7acc1a2..515b818cc5 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -75,7 +75,7 @@ namespace OpenSim.Groups m_GroupsService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs index 2b3a01d32d..32c24db42d 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs @@ -75,7 +75,7 @@ namespace OpenSim.OfflineIM m_OfflineIMService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs index 458272d10c..890df9091c 100644 --- a/OpenSim/Capabilities/CapsHandlers.cs +++ b/OpenSim/Capabilities/CapsHandlers.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework.Capabilities /// public class CapsHandlers { - private Dictionary m_capsHandlers = new Dictionary(); + private Dictionary m_capsHandlers = new Dictionary(); private IHttpServer m_httpListener; private string m_httpListenerHostName; private uint m_httpListenerPort; @@ -184,5 +184,17 @@ namespace OpenSim.Framework.Capabilities return caps; } + + /// + /// Returns a copy of the dictionary of all the HTTP cap handlers + /// + /// + /// The dictionary copy. The key is the capability name, the value is the HTTP handler. + /// + public Dictionary GetCapsHandlers() + { + lock (m_capsHandlers) + return new Dictionary(m_capsHandlers); + } } -} +} \ No newline at end of file diff --git a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs index 4dca59231e..426174d252 100644 --- a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs +++ b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Capabilities.Handlers m_PeopleService = peopleService; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Try to parse the texture ID from the request URL NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 9f3cc1992d..789bf2b33d 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs @@ -64,7 +64,7 @@ namespace OpenSim.Capabilities.Handlers m_assetService = assService; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Try to parse the texture ID from the request URL NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs index 5df24b2cc1..4fa1153cd6 100644 --- a/OpenSim/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Capabilities/LLSDStreamHandler.cs @@ -48,7 +48,7 @@ namespace OpenSim.Framework.Capabilities m_method = method; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { //Encoding encoding = Util.UTF8; diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs index ae7aaf2e3e..bbac699d3e 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs @@ -31,6 +31,10 @@ namespace OpenSim.Framework.Servers.HttpServer { public abstract class BaseRequestHandler { + public int RequestsReceived { get; protected set; } + + public int RequestsHandled { get; protected set; } + public virtual string ContentType { get { return "application/xml"; } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs index 6342983a55..252cc2ad81 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs @@ -29,14 +29,35 @@ using System.IO; namespace OpenSim.Framework.Servers.HttpServer { + /// + /// Base streamed request handler. + /// + /// + /// Inheriting classes should override ProcessRequest() rather than Handle() + /// public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler { - public abstract byte[] Handle(string path, Stream request, - IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); - protected BaseStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {} protected BaseStreamHandler(string httpMethod, string path, string name, string description) : base(httpMethod, path, name, description) {} + + public virtual byte[] Handle( + string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + { + RequestsReceived++; + + byte[] result = ProcessRequest(path, request, httpRequest, httpResponse); + + RequestsHandled++; + + return result; + } + + protected virtual byte[] ProcessRequest( + string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + { + return null; + } } } \ No newline at end of file diff --git a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs index b94bfb4311..1b03f543d3 100644 --- a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs @@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_method = binaryMethod; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { byte[] data = ReadFully(request); string param = GetParam(path); diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs index cb5cce5f79..b8541cbe4c 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs @@ -32,7 +32,6 @@ namespace OpenSim.Framework.Servers.HttpServer { public interface IRequestHandler { - /// /// Name for this handler. /// @@ -59,6 +58,19 @@ namespace OpenSim.Framework.Servers.HttpServer // Return path string Path { get; } + + /// + /// Number of requests received by this handler + /// + int RequestsReceived { get; } + + /// + /// Number of requests handled. + /// + /// + /// Should be equal to RequestsReceived unless requested are being handled slowly or there is deadlock. + /// + int RequestsHandled { get; } } public interface IStreamedRequestHandler : IRequestHandler @@ -69,7 +81,6 @@ namespace OpenSim.Framework.Servers.HttpServer public interface IStreamHandler : IRequestHandler { - // Handle request stream, return byte array void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse); } diff --git a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs index 07082a8ebb..bd55657815 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs @@ -33,7 +33,7 @@ namespace OpenSim.Framework.Servers.HttpServer { public delegate TResponse RestDeserialiseMethod(TRequest request); - public class RestDeserialiseHandler : BaseRequestHandler, IStreamHandler + public class RestDeserialiseHandler : BaseOutputStreamHandler, IStreamHandler where TRequest : new() { private RestDeserialiseMethod m_method; @@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_method = method; } - public void Handle(string path, Stream request, Stream responseStream, + protected override void ProcessRequest(string path, Stream request, Stream responseStream, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { TRequest deserial; diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index edcd134cae..83c9848e0d 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs @@ -183,7 +183,7 @@ namespace OpenSim.Framework.Servers.HttpServer public delegate bool CheckIdentityMethod(string sid, string aid); - public class RestDeserialiseSecureHandler : BaseRequestHandler, IStreamHandler + public class RestDeserialiseSecureHandler : BaseOutputStreamHandler, IStreamHandler where TRequest : new() { private static readonly ILog m_log @@ -201,7 +201,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_method = method; } - public void Handle(string path, Stream request, Stream responseStream, + protected override void ProcessRequest(string path, Stream request, Stream responseStream, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { RestSessionObject deserial = default(RestSessionObject); @@ -237,7 +237,7 @@ namespace OpenSim.Framework.Servers.HttpServer public delegate bool CheckTrustedSourceMethod(IPEndPoint peer); - public class RestDeserialiseTrustedHandler : BaseRequestHandler, IStreamHandler + public class RestDeserialiseTrustedHandler : BaseOutputStreamHandler, IStreamHandler where TRequest : new() { private static readonly ILog m_log @@ -260,7 +260,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_method = method; } - public void Handle(string path, Stream request, Stream responseStream, + protected override void ProcessRequest(string path, Stream request, Stream responseStream, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { TRequest deserial = default(TRequest); @@ -292,6 +292,5 @@ namespace OpenSim.Framework.Servers.HttpServer serializer.Serialize(xmlWriter, response); } } - } - -} + } +} \ No newline at end of file diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs index 1f17fee0d0..0305dee118 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs @@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_restMethod = restMethod; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { Encoding encoding = Encoding.UTF8; StreamReader streamReader = new StreamReader(request, encoding); diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 841069c5d3..f0c088a52b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -766,7 +766,7 @@ namespace OpenSim { public SimStatusHandler() : base("GET", "/simstatus", "SimStatus", "Simulator Status") {} - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return Util.UTF8.GetBytes("OK"); @@ -792,7 +792,7 @@ namespace OpenSim m_opensim = sim; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); @@ -810,7 +810,7 @@ namespace OpenSim /// If the request contains a key, "callback" the response will be wrappend in the /// associated value for jsonp used with ajax/javascript /// - public class UXSimStatusHandler : BaseStreamHandler + protected class UXSimStatusHandler : BaseStreamHandler { OpenSimBase m_opensim; @@ -820,7 +820,7 @@ namespace OpenSim m_opensim = sim; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs index 69dd76fe45..a133a69c8b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs @@ -176,7 +176,7 @@ namespace OpenSim.Region.ClientStack.Linden m_isGod = m_scene.Permissions.IsGod(agentID); } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader reader = new StreamReader(request); string message = reader.ReadToEnd(); diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 08196f14bb..21166053a0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_FriendsModule = fmodule; } - public override byte[] Handle( + protected override byte[] ProcessRequest( string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index c8b341ba91..bd60611d3d 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Text; using log4net; @@ -37,6 +38,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using Caps=OpenSim.Framework.Capabilities.Caps; @@ -58,6 +60,7 @@ namespace OpenSim.Region.CoreModules.Framework protected Dictionary m_capsObjects = new Dictionary(); protected Dictionary m_capsPaths = new Dictionary(); + protected Dictionary> m_childrenSeeds = new Dictionary>(); @@ -70,9 +73,24 @@ namespace OpenSim.Region.CoreModules.Framework m_scene = scene; m_scene.RegisterModuleInterface(this); - MainConsole.Instance.Commands.AddCommand("Comms", false, "show caps", - "show caps", - "Shows all registered capabilities for users", HandleShowCapsCommand); + MainConsole.Instance.Commands.AddCommand( + "Comms", false, "show caps list", + "show caps list", + "Shows list of registered capabilities for users.", HandleShowCapsListCommand); + + MainConsole.Instance.Commands.AddCommand( + "Comms", false, "show caps stats by user", + "show caps stats [ ]", + "Shows statistics on capabilities use by user.", + "If a user name is given, then prints a detailed breakdown of caps use ordered by number of requests received.", + HandleShowCapsStatsByUserCommand); + + MainConsole.Instance.Commands.AddCommand( + "Comms", false, "show caps stats by cap", + "show caps stats by cap []", + "Shows statistics on capabilities use by capability.", + "If a capability name is given, then prints a detailed breakdown of use by each user.", + HandleShowCapsStatsByCapCommand); } public void RegionLoaded(Scene scene) @@ -262,8 +280,11 @@ namespace OpenSim.Region.CoreModules.Framework } } - private void HandleShowCapsCommand(string module, string[] cmdparams) + private void HandleShowCapsListCommand(string module, string[] cmdParams) { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) + return; + StringBuilder caps = new StringBuilder(); caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); @@ -286,5 +307,210 @@ namespace OpenSim.Region.CoreModules.Framework MainConsole.Instance.Output(caps.ToString()); } + + private void HandleShowCapsStatsByCapCommand(string module, string[] cmdParams) + { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) + return; + + if (cmdParams.Length != 5 && cmdParams.Length != 6) + { + MainConsole.Instance.Output("Usage: show caps stats by cap []"); + return; + } + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("Region {0}:\n", m_scene.Name); + + if (cmdParams.Length == 5) + { + BuildSummaryStatsByCapReport(sb); + } + else if (cmdParams.Length == 6) + { + BuildDetailedStatsByCapReport(sb, cmdParams[5]); + } + + MainConsole.Instance.Output(sb.ToString()); + } + + private void BuildDetailedStatsByCapReport(StringBuilder sb, string capName) + { + sb.AppendFormat("Capability name {0}\n", capName); + + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("User Name", 34); + cdt.AddColumn("Req Received", 12); + cdt.AddColumn("Req Handled", 12); + cdt.Indent = 2; + + Dictionary receivedStats = new Dictionary(); + Dictionary handledStats = new Dictionary(); + + m_scene.ForEachScenePresence( + sp => + { + Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); + + if (caps == null) + return; + + Dictionary capsHandlers = caps.CapsHandlers.GetCapsHandlers(); + + IRequestHandler reqHandler; + if (capsHandlers.TryGetValue(capName, out reqHandler)) + { + receivedStats[sp.Name] = reqHandler.RequestsReceived; + handledStats[sp.Name] = reqHandler.RequestsHandled; + } + } + ); + + foreach (KeyValuePair kvp in receivedStats.OrderByDescending(kp => kp.Value)) + { + cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); + } + + sb.Append(cdt.ToString()); + } + + private void BuildSummaryStatsByCapReport(StringBuilder sb) + { + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Name", 34); + cdt.AddColumn("Req Received", 12); + cdt.AddColumn("Req Handled", 12); + cdt.Indent = 2; + + Dictionary receivedStats = new Dictionary(); + Dictionary handledStats = new Dictionary(); + + m_scene.ForEachScenePresence( + sp => + { + Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); + + if (caps == null) + return; + + Dictionary capsHandlers = caps.CapsHandlers.GetCapsHandlers(); + + foreach (IRequestHandler reqHandler in capsHandlers.Values) + { + string reqName = reqHandler.Name ?? ""; + + if (!receivedStats.ContainsKey(reqName)) + { + receivedStats[reqName] = reqHandler.RequestsReceived; + handledStats[reqName] = reqHandler.RequestsHandled; + } + else + { + receivedStats[reqName] += reqHandler.RequestsReceived; + handledStats[reqName] += reqHandler.RequestsHandled; + } + } + } + ); + + foreach (KeyValuePair kvp in receivedStats.OrderByDescending(kp => kp.Value)) + cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); + + sb.Append(cdt.ToString()); + } + + private void HandleShowCapsStatsByUserCommand(string module, string[] cmdParams) + { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) + return; + + if (cmdParams.Length != 5 && cmdParams.Length != 7) + { + MainConsole.Instance.Output("Usage: show caps stats by user [ ]"); + return; + } + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("Region {0}:\n", m_scene.Name); + + if (cmdParams.Length == 5) + { + BuildSummaryStatsByUserReport(sb); + } + else if (cmdParams.Length == 7) + { + string firstName = cmdParams[5]; + string lastName = cmdParams[6]; + + ScenePresence sp = m_scene.GetScenePresence(firstName, lastName); + + if (sp == null) + return; + + BuildDetailedStatsByUserReport(sb, sp); + } + + MainConsole.Instance.Output(sb.ToString()); + } + + private void BuildDetailedStatsByUserReport(StringBuilder sb, ScenePresence sp) + { + sb.AppendFormat("Avatar name {0}, type {1}\n", sp.Name, sp.IsChildAgent ? "child" : "root"); + + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Cap Name", 34); + cdt.AddColumn("Req Received", 12); + cdt.AddColumn("Req Handled", 12); + cdt.Indent = 2; + + Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); + + if (caps == null) + return; + + Dictionary capsHandlers = caps.CapsHandlers.GetCapsHandlers(); + + foreach (IRequestHandler reqHandler in capsHandlers.Values.OrderByDescending(rh => rh.RequestsReceived)) + { + cdt.AddRow(reqHandler.Name, reqHandler.RequestsReceived, reqHandler.RequestsHandled); + } + + sb.Append(cdt.ToString()); + } + + private void BuildSummaryStatsByUserReport(StringBuilder sb) + { + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Name", 32); + cdt.AddColumn("Type", 5); + cdt.AddColumn("Req Received", 12); + cdt.AddColumn("Req Handled", 12); + cdt.Indent = 2; + + m_scene.ForEachScenePresence( + sp => + { + Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); + + if (caps == null) + return; + + Dictionary capsHandlers = caps.CapsHandlers.GetCapsHandlers(); + + int totalRequestsReceived = 0; + int totalRequestsHandled = 0; + + foreach (IRequestHandler reqHandler in capsHandlers.Values) + { + totalRequestsReceived += reqHandler.RequestsReceived; + totalRequestsHandled += reqHandler.RequestsHandled; + } + + cdt.AddRow(sp.Name, sp.IsChildAgent ? "child" : "root", totalRequestsReceived, totalRequestsHandled); + } + ); + + sb.Append(cdt.ToString()); + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs index eb74cdab76..236676777c 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.World.Estate m_EstateModule = fmodule; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index 726becf3b5..f208afb758 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); } - public override byte[] Handle( + protected override byte[] ProcessRequest( string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return Util.UTF8.GetBytes(Report()); diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs index 1ea1c20284..6e0a80abaf 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs @@ -281,7 +281,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport m_module = module; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader reader = new StreamReader(request); string requestBody = reader.ReadToEnd(); diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index 550b5d437a..8720cc78c5 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView m_WorldViewModule = fmodule; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { httpResponse.ContentType = "image/jpeg"; diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index 986394bf59..941b97d2f0 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs @@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Asset m_allowedTypes = allowedTypes; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { bool result = false; diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs index 8f7412bd77..8b23a832ac 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs @@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset m_AssetService = service; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { byte[] result = new byte[0]; diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs index a006fa8395..8eebc61609 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs @@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset m_AssetService = service; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { AssetBase asset; diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 6b93cd9035..16e011aaea 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs @@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Authentication } } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { string[] p = SplitParams(path); diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs index 18cef154e5..66a26fc78d 100644 --- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs @@ -147,7 +147,7 @@ namespace OpenSim.Server.Handlers.Authentication #endregion } - public class OpenIdStreamHandler : IStreamHandler + public class OpenIdStreamHandler : BaseOutputStreamHandler { #region HTML @@ -191,42 +191,34 @@ For more information, see http://openid.net/. #endregion HTML - public string Name { get { return "OpenId"; } } - public string Description { get { return null; } } - public string ContentType { get { return m_contentType; } } - public string HttpMethod { get { return m_httpMethod; } } - public string Path { get { return m_path; } } - - string m_contentType; - string m_httpMethod; - string m_path; IAuthenticationService m_authenticationService; IUserAccountService m_userAccountService; ProviderMemoryStore m_openidStore = new ProviderMemoryStore(); + public override string ContentType { get { return "text/html"; } } + /// /// Constructor /// - public OpenIdStreamHandler(string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService) + public OpenIdStreamHandler( + string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService) + : base(httpMethod, path, "OpenId", "OpenID stream handler") { m_authenticationService = authService; m_userAccountService = userService; - m_httpMethod = httpMethod; - m_path = path; - - m_contentType = "text/html"; } /// /// Handles all GET and POST requests for OpenID identifier pages and endpoint /// server communication /// - public void Handle(string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override void ProcessRequest( + string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath)); // Defult to returning HTML content - m_contentType = "text/html"; + httpResponse.ContentType = ContentType; try { @@ -276,7 +268,7 @@ For more information, see http://openid.net/. string[] contentTypeValues = provider.Request.Response.Headers.GetValues("Content-Type"); if (contentTypeValues != null && contentTypeValues.Length == 1) - m_contentType = contentTypeValues[0]; + httpResponse.ContentType = contentTypeValues[0]; // Set the response code and document body based on the OpenID result httpResponse.StatusCode = (int)provider.Request.Response.Code; @@ -344,4 +336,4 @@ For more information, see http://openid.net/. return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs index bcf9d477e3..c9b4e9b0d2 100644 --- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs @@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Authorization m_AuthorizationService = service; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest)); diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 8cd747ee17..d6bbb8fc4e 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Avatar m_AvatarService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index 47a85581af..ca0a24c36f 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs @@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Friends m_FriendsService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index ef5f33e173..89cba8a7d8 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Grid m_GridService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 7483395124..0b98e9a12b 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.GridUser m_GridUserService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 0aa272973f..a2bdadb1aa 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs @@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!"); } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index f306b1c757..06eaf2ec8d 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs @@ -91,7 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid m_HandlersType = handlersType; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return OKResponse(httpResponse); diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index df875af14d..f37f2f1e24 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs @@ -68,6 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid { return new ExtendedAgentDestinationData(); } + protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request) { base.UnpackData(args, d, request); diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs index 231e32f6fb..e2c50fe1fa 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Inventory m_InventoryService = service; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { XmlSerializer xs = new XmlSerializer(typeof (List)); diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 9d28dc3c6d..0d7c13669c 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -87,7 +87,7 @@ namespace OpenSim.Server.Handlers.Asset m_InventoryService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index 4a619698bc..d438fc7487 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs @@ -99,7 +99,7 @@ namespace OpenSim.Server.Handlers.MapImage m_Proxy = proxy; } - public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index fb85d1ce1c..7bb2f39820 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs @@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.MapImage m_MapService = service; } - public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { byte[] result = new byte[0]; diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs index 8a1f824dbd..3525a01a71 100644 --- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs +++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs @@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Neighbour // TODO: unused: m_AuthenticationService = authentication; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Not implemented yet @@ -83,7 +83,7 @@ namespace OpenSim.Server.Handlers.Neighbour // TODO: unused: m_AllowForeignGuests = foreignGuests; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { byte[] result = new byte[0]; @@ -176,7 +176,7 @@ namespace OpenSim.Server.Handlers.Neighbour // TODO: unused: m_AuthenticationService = authentication; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Not implemented yet @@ -197,7 +197,7 @@ namespace OpenSim.Server.Handlers.Neighbour // TODO: unused: m_AuthenticationService = authentication; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // Not implemented yet diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 2d67c6db0c..abb4b19642 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Presence m_PresenceService = service; } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData); diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 71a9e6fa41..a9fd4ed4a4 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -251,7 +251,7 @@ namespace OpenSim.Server.Handlers.Simulation m_SimulationService = null; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // m_log.DebugFormat("[SIMULATION]: Stream handler called"); @@ -457,7 +457,7 @@ namespace OpenSim.Server.Handlers.Simulation m_SimulationService = null; } - public override byte[] Handle(string path, Stream request, + protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // m_log.DebugFormat("[SIMULATION]: Stream handler called"); diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 72551ef404..24c9de6a9d 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs @@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts } } - public override byte[] Handle(string path, Stream requestData, + protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { StreamReader sr = new StreamReader(requestData);