fixing Rest/Inventory stuff again. changes somehow got lost locally.

0.6.0-stable
Dr Scofield 2008-08-20 15:28:51 +00:00
parent 61e6d72cbc
commit 2363cd2113
5 changed files with 11 additions and 20 deletions

View File

@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// </remarks> /// </remarks>
public delegate void RestMethodHandler(RequestData rdata); public delegate void RestMethodHandler(RequestData rdata);
public delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response); public delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response, string path);
/// <summary> /// <summary>
/// This interface represents the boundary between the general purpose /// This interface represents the boundary between the general purpose

View File

@ -102,9 +102,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
#region Interface #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 // Asset Handler

View File

@ -56,16 +56,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public class RestHandler : RestPlugin, IRestHandler, IHttpAgentHandler public class RestHandler : RestPlugin, IRestHandler, IHttpAgentHandler
{ {
/// <remarks>
/// 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.
/// </remarks>
// 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 // Handler tables: both stream and REST are supported. The path handlers and their
// respective allocators are stored in separate tables. // respective allocators are stored in separate tables.
@ -623,7 +613,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!String.IsNullOrEmpty(bestMatch)) 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); Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch);

View File

@ -128,9 +128,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <param name=qPrefix>REST service domain prefix</param> /// <param name=qPrefix>REST service domain prefix</param>
/// <returns>A RequestData instance suitable for this service</returns> /// <returns>A RequestData instance suitable for this service</returns>
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);
} }
/// <summary> /// <summary>
@ -2168,7 +2168,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
} }
break; break;
default : 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; break;
} }
} }
@ -2177,7 +2178,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// If this is a TGA remember the fact /// If this is a TGA remember the fact
if (ic.Item.AssetType == (int) AssetType.TextureTGA || if (ic.Item.AssetType == (int) AssetType.TextureTGA ||
ic.Item.AssetType == (int) AssetType.ImageTGA) ic.Item.AssetType == (int) AssetType.ImageTGA)
{ {
Bitmap temp; Bitmap temp;
Stream tgadata = new MemoryStream(ic.Asset.Data); Stream tgadata = new MemoryStream(ic.Asset.Data);

View File

@ -110,9 +110,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
#region Interface #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 // Inventory Handler