From 2363cd2113261ac456e18f79e9e37622d2c7eca7 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 20 Aug 2008 15:28:51 +0000 Subject: fixing Rest/Inventory stuff again. changes somehow got lost locally. --- OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs | 2 +- .../ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | 4 ++-- OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs | 12 +----------- .../Rest/Inventory/RestInventoryServices.cs | 9 +++++---- .../ApplicationPlugins/Rest/Inventory/RestTestServices.cs | 4 ++-- 5 files changed, 11 insertions(+), 20 deletions(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs index f67f8b1..69f91e4 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs @@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// public delegate void RestMethodHandler(RequestData rdata); - public delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response); + public delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response, string path); /// /// This interface represents the boundary between the general purpose diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index a40d197..9e4fae6 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -102,9 +102,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory #region Interface - private RequestData Allocate(OSHttpRequest request, OSHttpResponse response) + private RequestData Allocate(OSHttpRequest request, OSHttpResponse response, string prefix) { - return (RequestData) new AssetRequestData(request, response, qPrefix); + return (RequestData) new AssetRequestData(request, response, prefix); } // Asset Handler diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index cb80846..61cf0e4 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs @@ -56,16 +56,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public class RestHandler : RestPlugin, IRestHandler, IHttpAgentHandler { - /// - /// The handler delegates are not noteworthy. The allocator allows - /// a given handler to optionally subclass the base RequestData - /// structure to carry any locally required per-request state - /// needed. - /// - - // internal delegate void RestMethodHandler(RequestData rdata); - // internal delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response); - // Handler tables: both stream and REST are supported. The path handlers and their // respective allocators are stored in separate tables. @@ -623,7 +613,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!String.IsNullOrEmpty(bestMatch)) { - rdata = pathAllocators[bestMatch](request, response); + rdata = pathAllocators[bestMatch](request, response, bestMatch); Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch); diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 6a0fdf2..1ea598e 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -128,9 +128,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// REST service domain prefix /// A RequestData instance suitable for this service - private RequestData Allocate(OSHttpRequest request, OSHttpResponse response) + private RequestData Allocate(OSHttpRequest request, OSHttpResponse response, string prefix) { - return (RequestData) new InventoryRequestData(request, response, qPrefix); + return (RequestData) new InventoryRequestData(request, response, prefix); } /// @@ -2168,7 +2168,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } break; default : - Rest.Log.DebugFormat("{0} Type was not inferred", MsgId); + Rest.Log.DebugFormat("{0} Asset/Inventory type could not be inferred for {1}", + MsgId,ic.Item.Name); break; } } @@ -2177,7 +2178,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// If this is a TGA remember the fact if (ic.Item.AssetType == (int) AssetType.TextureTGA || - ic.Item.AssetType == (int) AssetType.ImageTGA) + ic.Item.AssetType == (int) AssetType.ImageTGA) { Bitmap temp; Stream tgadata = new MemoryStream(ic.Asset.Data); diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestTestServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestTestServices.cs index 984f6d3..3ac48c9 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestTestServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestTestServices.cs @@ -110,9 +110,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory #region Interface - private RequestData Allocate(OSHttpRequest request, OSHttpResponse response) + private RequestData Allocate(OSHttpRequest request, OSHttpResponse response, string prefix) { - return new RequestData(request, response, qPrefix); + return new RequestData(request, response, prefix); } // Inventory Handler -- cgit v1.1