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.
0.7.4.1
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

@ -63,7 +63,8 @@ namespace OpenSim.Capabilities.Handlers
FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
IRequestHandler reqHandler IRequestHandler reqHandler
= new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest); = new RestStreamHandler(
"POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null);
server.AddStreamHandler(reqHandler); server.AddStreamHandler(reqHandler);
} }
} }

View File

@ -66,13 +66,14 @@ namespace OpenSim.Capabilities.Handlers
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), IRequestHandler reqHandler
delegate(Hashtable m_dhttpMethod) = new RestHTTPHandler(
{ "GET",
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); "/CAPS/" + UUID.Random(),
}); httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
"GetMesh",
null);
server.AddStreamHandler(reqHandler); server.AddStreamHandler(reqHandler);
} }
} }
} }

View File

@ -58,8 +58,8 @@ namespace OpenSim.Capabilities.Handlers
// TODO: Change this to a config option // TODO: Change this to a config option
const string REDIRECT_URL = null; const string REDIRECT_URL = null;
public GetTextureHandler(string path, IAssetService assService) : public GetTextureHandler(string path, IAssetService assService, string name, string description)
base("GET", path) : base("GET", path, name, description)
{ {
m_assetService = assService; m_assetService = assService;
} }

View File

@ -62,8 +62,8 @@ namespace OpenSim.Capabilities.Handlers
if (m_AssetService == null) if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService)); server.AddStreamHandler(
new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null));
} }
} }
} }

View File

@ -52,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
// Overkill - we only really need the asset service, not a whole scene. // Overkill - we only really need the asset service, not a whole scene.
Scene scene = new SceneHelpers().SetupScene(); Scene scene = new SceneHelpers().SetupScene();
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null);
TestOSHttpRequest req = new TestOSHttpRequest(); TestOSHttpRequest req = new TestOSHttpRequest();
TestOSHttpResponse resp = new TestOSHttpResponse(); TestOSHttpResponse resp = new TestOSHttpResponse();
req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012");

View File

@ -85,8 +85,8 @@ namespace OpenSim.Capabilities.Handlers
uploader.OnUpLoad += BakedTextureUploaded; uploader.OnUpLoad += BakedTextureUploaded;
m_HostCapsObj.HttpListener.AddStreamHandler( m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, new BinaryStreamHandler(
uploader.uploaderCaps)); "POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null));
string protocol = "http://"; string protocol = "http://";

View File

@ -68,7 +68,13 @@ namespace OpenSim.Capabilities.Handlers
ServerUtils.LoadPlugin<ILibraryService>(libService, args); ServerUtils.LoadPlugin<ILibraryService>(libService, args);
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest); IRequestHandler reqHandler
= new RestStreamHandler(
"POST",
"/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/,
webFetchHandler.FetchInventoryDescendentsRequest,
"WebFetchInvDesc",
null);
server.AddStreamHandler(reqHandler); server.AddStreamHandler(reqHandler);
} }

View File

@ -39,7 +39,11 @@ namespace OpenSim.Framework.Capabilities
private LLSDMethod<TRequest, TResponse> m_method; private LLSDMethod<TRequest, TResponse> m_method;
public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method)
: base(httpMethod, path) : this(httpMethod, path, method, null, null) {}
public LLSDStreamhandler(
string httpMethod, string path, LLSDMethod<TRequest, TResponse> method, string name, string description)
: base(httpMethod, path, name, description)
{ {
m_method = method; m_method = method;
} }

View File

@ -33,9 +33,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
public abstract Hashtable Handle(string path, Hashtable Request); public abstract Hashtable Handle(string path, Hashtable Request);
protected BaseHTTPHandler(string httpMethod, string path) protected BaseHTTPHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
: base(httpMethod, path)
{ protected BaseHTTPHandler(string httpMethod, string path, string name, string description)
} : base(httpMethod, path, name, description) {}
} }
} }

View File

@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
public List<string> GetStreamHandlerKeys() public List<string> GetStreamHandlerKeys()
{ {
lock (m_streamHandlers) lock (m_streamHandlers)
return new List<string>(m_streamHandlers.Keys); return new List<string>(m_streamHandlers.Keys);
@ -410,6 +410,8 @@ namespace OpenSim.Framework.Servers.HttpServer
// string reqnum = "unknown"; // string reqnum = "unknown";
int tickstart = Environment.TickCount; int tickstart = Environment.TickCount;
IRequestHandler requestHandler = null;
try try
{ {
// OpenSim.Framework.WebUtil.OSHeaderRequestID // OpenSim.Framework.WebUtil.OSHeaderRequestID
@ -438,8 +440,6 @@ namespace OpenSim.Framework.Servers.HttpServer
//response.KeepAlive = true; //response.KeepAlive = true;
response.SendChunked = false; response.SendChunked = false;
IRequestHandler requestHandler;
string path = request.RawUrl; string path = request.RawUrl;
string handlerKey = GetHandlerKey(request.HttpMethod, path); string handlerKey = GetHandlerKey(request.HttpMethod, path);
@ -675,8 +675,16 @@ namespace OpenSim.Framework.Servers.HttpServer
// since its just for reporting, tickdiff limit can be adjusted // since its just for reporting, tickdiff limit can be adjusted
int tickdiff = Environment.TickCount - tickstart; int tickdiff = Environment.TickCount - tickstart;
if (tickdiff > 3000) if (tickdiff > 3000)
{
m_log.InfoFormat( m_log.InfoFormat(
"[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff); "[BASE HTTP SERVER]: slow {0} for {1} {2} {3} from {4} took {5} ms",
requestMethod,
uriString,
requestHandler != null ? requestHandler.Name : "",
requestHandler != null ? requestHandler.Description : "",
request.RemoteIPEndPoint.ToString(),
tickdiff);
}
} }
} }

View File

@ -45,8 +45,16 @@ namespace OpenSim.Framework.Servers.HttpServer
private readonly string m_path; private readonly string m_path;
protected BaseRequestHandler(string httpMethod, string path) public string Name { get; private set; }
public string Description { get; private set; }
protected BaseRequestHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
protected BaseRequestHandler(string httpMethod, string path, string name, string description)
{ {
Name = name;
Description = description;
m_httpMethod = httpMethod; m_httpMethod = httpMethod;
m_path = path; m_path = path;
} }

View File

@ -34,8 +34,9 @@ namespace OpenSim.Framework.Servers.HttpServer
public abstract byte[] Handle(string path, Stream request, public abstract byte[] Handle(string path, Stream request,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path) 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) {}
} }
} }

View File

@ -36,6 +36,15 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
private BinaryMethod m_method; private BinaryMethod m_method;
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
: this(httpMethod, path, binaryMethod, null, null) {}
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod, string name, string description)
: base(httpMethod, path, name, description)
{
m_method = binaryMethod;
}
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
byte[] data = ReadFully(request); byte[] data = ReadFully(request);
@ -45,12 +54,6 @@ namespace OpenSim.Framework.Servers.HttpServer
return Encoding.UTF8.GetBytes(responseString); return Encoding.UTF8.GetBytes(responseString);
} }
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
: base(httpMethod, path)
{
m_method = binaryMethod;
}
private static byte[] ReadFully(Stream stream) private static byte[] ReadFully(Stream stream)
{ {
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
@ -70,4 +73,4 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
} }
} }

View File

@ -32,6 +32,25 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
public interface IRequestHandler public interface IRequestHandler
{ {
/// <summary>
/// Name for this handler.
/// </summary>
/// <remarks>
/// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
/// specified.
/// </remarks>
string Name { get; }
/// <summary>
/// Description for this handler.
/// </summary>
/// <remarks>
/// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
/// specified.
/// </remarks>
string Description { get; }
// Return response content type // Return response content type
string ContentType { get; } string ContentType { get; }
@ -58,4 +77,4 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
Hashtable Handle(string path, Hashtable request); Hashtable Handle(string path, Hashtable request);
} }
} }

View File

@ -39,7 +39,11 @@ namespace OpenSim.Framework.Servers.HttpServer
private RestDeserialiseMethod<TRequest, TResponse> m_method; private RestDeserialiseMethod<TRequest, TResponse> m_method;
public RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method) public RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method)
: base(httpMethod, path) : this(httpMethod, path, method, null, null) {}
public RestDeserialiseHandler(
string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method, string name, string description)
: base(httpMethod, path, name, description)
{ {
m_method = method; m_method = method;
} }

View File

@ -38,19 +38,25 @@ namespace OpenSim.Framework.Servers.HttpServer
get { return m_dhttpMethod; } get { return m_dhttpMethod; }
} }
public override Hashtable Handle(string path, Hashtable request)
{
string param = GetParam(path);
request.Add("param", param);
request.Add("path", path);
return m_dhttpMethod(request);
}
public RestHTTPHandler(string httpMethod, string path, GenericHTTPMethod dhttpMethod) public RestHTTPHandler(string httpMethod, string path, GenericHTTPMethod dhttpMethod)
: base(httpMethod, path) : base(httpMethod, path)
{ {
m_dhttpMethod = dhttpMethod; m_dhttpMethod = dhttpMethod;
} }
public RestHTTPHandler(
string httpMethod, string path, GenericHTTPMethod dhttpMethod, string name, string description)
: base(httpMethod, path, name, description)
{
m_dhttpMethod = dhttpMethod;
}
public override Hashtable Handle(string path, Hashtable request)
{
string param = GetParam(path);
request.Add("param", param);
request.Add("path", path);
return m_dhttpMethod(request);
}
} }
} }

View File

@ -39,6 +39,15 @@ namespace OpenSim.Framework.Servers.HttpServer
get { return m_restMethod; } get { return m_restMethod; }
} }
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod)
: this(httpMethod, path, restMethod, null, null) {}
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod, string name, string description)
: base(httpMethod, path, name, description)
{
m_restMethod = restMethod;
}
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
Encoding encoding = Encoding.UTF8; Encoding encoding = Encoding.UTF8;
@ -52,10 +61,5 @@ namespace OpenSim.Framework.Servers.HttpServer
return Encoding.UTF8.GetBytes(responseString); return Encoding.UTF8.GetBytes(responseString);
} }
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base(httpMethod, path)
{
m_restMethod = restMethod;
}
} }
} }

View File

@ -388,7 +388,7 @@ namespace OpenSim
scene.LoadPrimsFromStorage(regionInfo.originRegionID); scene.LoadPrimsFromStorage(regionInfo.originRegionID);
// TODO : Try setting resource for region xstats here on scene // TODO : Try setting resource for region xstats here on scene
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate(); scene.EventManager.TriggerParcelPrimCountUpdate();
@ -773,6 +773,9 @@ namespace OpenSim
return Util.UTF8.GetBytes("OK"); return Util.UTF8.GetBytes("OK");
} }
public string Name { get { return "SimStatus"; } }
public string Description { get { return "Simulator Status"; } }
public string ContentType public string ContentType
{ {
get { return "text/plain"; } get { return "text/plain"; }
@ -797,6 +800,9 @@ namespace OpenSim
{ {
OpenSimBase m_opensim; OpenSimBase m_opensim;
string osXStatsURI = String.Empty; string osXStatsURI = String.Empty;
public string Name { get { return "XSimStatus"; } }
public string Description { get { return "Simulator XStatus"; } }
public XSimStatusHandler(OpenSimBase sim) public XSimStatusHandler(OpenSimBase sim)
{ {
@ -837,6 +843,9 @@ namespace OpenSim
{ {
OpenSimBase m_opensim; OpenSimBase m_opensim;
string osUXStatsURI = String.Empty; string osUXStatsURI = String.Empty;
public string Name { get { return "UXSimStatus"; } }
public string Description { get { return "Simulator UXStatus"; } }
public UXSimStatusHandler(OpenSimBase sim) public UXSimStatusHandler(OpenSimBase sim)
{ {

View File

@ -155,7 +155,9 @@ namespace OpenSim.Region.ClientStack.Linden
try try
{ {
// the root of all evil // the root of all evil
m_HostCapsObj.RegisterHandler("SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest)); m_HostCapsObj.RegisterHandler(
"SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null));
m_log.DebugFormat( m_log.DebugFormat(
"[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID); "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
@ -163,7 +165,10 @@ namespace OpenSim.Region.ClientStack.Linden
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
// capsBase + m_mapLayerPath, // capsBase + m_mapLayerPath,
// GetMapLayer); // GetMapLayer);
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); IRequestHandler req
= new RestStreamHandler(
"POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory, "UpdateScript", null);
m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req); m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptTask", req); m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
} }
@ -178,14 +183,27 @@ namespace OpenSim.Region.ClientStack.Linden
try try
{ {
// I don't think this one works... // I don't think this one works...
m_HostCapsObj.RegisterHandler("NewFileAgentInventory", new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", m_HostCapsObj.RegisterHandler(
capsBase + m_newInventory, "NewFileAgentInventory",
NewAgentInventoryRequest)); new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>(
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory); "POST",
capsBase + m_newInventory,
NewAgentInventoryRequest,
"NewFileAgentInventory",
null));
IRequestHandler req
= new RestStreamHandler(
"POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory, "Update*", null);
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
m_HostCapsObj.RegisterHandler(
"CopyInventoryFromNotecard",
new RestStreamHandler(
"POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null));
// As of RC 1.22.9 of the Linden client this is // As of RC 1.22.9 of the Linden client this is
// supported // supported
@ -289,7 +307,9 @@ namespace OpenSim.Region.ClientStack.Linden
m_dumpAssetsToFile); m_dumpAssetsToFile);
uploader.OnUpLoad += TaskScriptUpdated; uploader.OnUpLoad += TaskScriptUpdated;
m_HostCapsObj.HttpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler(
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "BunchOfCaps", null));
string protocol = "http://"; string protocol = "http://";
@ -416,8 +436,14 @@ namespace OpenSim.Region.ClientStack.Linden
AssetUploader uploader = AssetUploader uploader =
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile); llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
m_HostCapsObj.HttpListener.AddStreamHandler( m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); new BinaryStreamHandler(
"POST",
capsBase + uploaderPath,
uploader.uploaderCaps,
"NewAgentInventoryRequest",
m_HostCapsObj.AgentID.ToString()));
string protocol = "http://"; string protocol = "http://";
@ -733,7 +759,8 @@ namespace OpenSim.Region.ClientStack.Linden
uploader.OnUpLoad += ItemUpdated; uploader.OnUpLoad += ItemUpdated;
m_HostCapsObj.HttpListener.AddStreamHandler( m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); new BinaryStreamHandler(
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null));
string protocol = "http://"; string protocol = "http://";

View File

@ -351,14 +351,18 @@ namespace OpenSim.Region.ClientStack.Linden
// EventQueueGet when it receive capability information, but then we replace the rest handler immediately // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
// afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but
// really it should be possible to directly register the poll handler as a capability. // really it should be possible to directly register the poll handler as a capability.
caps.RegisterHandler("EventQueueGet", caps.RegisterHandler(
new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", null)); "EventQueueGet",
new RestHTTPHandler(
"POST", capsBase + EventQueueGetUUID.ToString() + "/", null));
// delegate(Hashtable m_dhttpMethod) // delegate(Hashtable m_dhttpMethod)
// { // {
// return ProcessQueue(m_dhttpMethod, agentID, caps); // return ProcessQueue(m_dhttpMethod, agentID, caps);
// })); // }));
// This will persist this beyond the expiry of the caps handlers // This will persist this beyond the expiry of the caps handlers
// TODO: Add EventQueueGet name/description for diagnostics
MainServer.Instance.AddPollServiceHTTPHandler( MainServer.Instance.AddPollServiceHTTPHandler(
capsBase + EventQueueGetUUID.ToString() + "/", capsBase + EventQueueGetUUID.ToString() + "/",
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));

View File

@ -132,7 +132,8 @@ namespace OpenSim.Region.ClientStack.Linden
capUrl = "/CAPS/" + UUID.Random(); capUrl = "/CAPS/" + UUID.Random();
IRequestHandler reqHandler IRequestHandler reqHandler
= new RestStreamHandler("POST", capUrl, m_fetchHandler.FetchInventoryRequest); = new RestStreamHandler(
"POST", capUrl, m_fetchHandler.FetchInventoryRequest, capName, agentID.ToString());
caps.RegisterHandler(capName, reqHandler); caps.RegisterHandler(capName, reqHandler);
} }

View File

@ -120,11 +120,13 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); // m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), IRequestHandler reqHandler
delegate(Hashtable m_dhttpMethod) = new RestHTTPHandler(
{ "GET",
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); "/CAPS/" + UUID.Random(),
}); httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
"GetMesh",
agentID.ToString());
caps.RegisterHandler("GetMesh", reqHandler); caps.RegisterHandler("GetMesh", reqHandler);
} }

View File

@ -130,7 +130,9 @@ namespace OpenSim.Region.ClientStack.Linden
if (m_URL == "localhost") if (m_URL == "localhost")
{ {
// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); // m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService)); caps.RegisterHandler(
"GetTexture",
new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString()));
} }
else else
{ {

View File

@ -117,7 +117,9 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag); IRequestHandler reqHandler
= new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag, "MeshUploadFlag", agentID.ToString());
caps.RegisterHandler("MeshUploadFlag", reqHandler); caps.RegisterHandler("MeshUploadFlag", reqHandler);
m_agentID = agentID; m_agentID = agentID;
} }

View File

@ -115,67 +115,66 @@ namespace OpenSim.Region.ClientStack.Linden
UUID capID = UUID.Random(); UUID capID = UUID.Random();
// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID); // m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);
caps.RegisterHandler("NewFileAgentInventoryVariablePrice", caps.RegisterHandler(
"NewFileAgentInventoryVariablePrice",
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST", new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>(
"/CAPS/" + capID.ToString(), "POST",
delegate(LLSDAssetUploadRequest req) "/CAPS/" + capID.ToString(),
{ req => NewAgentInventoryRequest(req, agentID),
return NewAgentInventoryRequest(req,agentID); "NewFileAgentInventoryVariablePrice",
})); agentID.ToString()));
} }
#endregion #endregion
public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID) public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID)
{ {
//TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit //TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit
// You need to be aware of this and // you need to be aware of this
//if (llsdRequest.asset_type == "texture" || //if (llsdRequest.asset_type == "texture" ||
// llsdRequest.asset_type == "animation" || // llsdRequest.asset_type == "animation" ||
// llsdRequest.asset_type == "sound") // llsdRequest.asset_type == "sound")
// { // {
// check user level // check user level
ScenePresence avatar = null;
IClientAPI client = null;
m_scene.TryGetScenePresence(agentID, out avatar);
if (avatar != null) ScenePresence avatar = null;
IClientAPI client = null;
m_scene.TryGetScenePresence(agentID, out avatar);
if (avatar != null)
{
client = avatar.ControllingClient;
if (avatar.UserLevel < m_levelUpload)
{ {
client = avatar.ControllingClient; if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
if (avatar.UserLevel < m_levelUpload) LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
{ errorResponse.rsvp = "";
if (client != null) errorResponse.state = "error";
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false); return errorResponse;
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
errorResponse.rsvp = "";
errorResponse.state = "error";
return errorResponse;
}
} }
}
// check funds // check funds
IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
if (mm != null) if (mm != null)
{
if (!mm.UploadCovered(agentID, mm.UploadCharge))
{ {
if (!mm.UploadCovered(agentID, mm.UploadCharge)) if (client != null)
{ client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
errorResponse.rsvp = ""; errorResponse.rsvp = "";
errorResponse.state = "error"; errorResponse.state = "error";
return errorResponse; return errorResponse;
}
} }
}
// } // }
string assetName = llsdRequest.name; string assetName = llsdRequest.name;
@ -189,8 +188,14 @@ namespace OpenSim.Region.ClientStack.Linden
AssetUploader uploader = AssetUploader uploader =
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile); llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile);
MainServer.Instance.AddStreamHandler( MainServer.Instance.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); new BinaryStreamHandler(
"POST",
capsBase + uploaderPath,
uploader.uploaderCaps,
"NewFileAgentInventoryVariablePrice",
agentID.ToString()));
string protocol = "http://"; string protocol = "http://";
@ -199,10 +204,9 @@ namespace OpenSim.Region.ClientStack.Linden
string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase + string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase +
uploaderPath; uploaderPath;
LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
uploadResponse.rsvp = uploaderURL; uploadResponse.rsvp = uploaderURL;
uploadResponse.state = "upload"; uploadResponse.state = "upload";
@ -220,6 +224,7 @@ namespace OpenSim.Region.ClientStack.Linden
pinventoryItem, pparentFolder, pdata, pinventoryType, pinventoryItem, pparentFolder, pdata, pinventoryType,
passetType,agentID); passetType,agentID);
}; };
return uploadResponse; return uploadResponse;
} }

View File

@ -66,12 +66,14 @@ namespace OpenSim.Region.ClientStack.Linden
// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); // m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
caps.RegisterHandler("ObjectAdd", caps.RegisterHandler(
new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", "ObjectAdd",
delegate(Hashtable m_dhttpMethod) new RestHTTPHandler(
{ "POST",
return ProcessAdd(m_dhttpMethod, agentID, caps); "/CAPS/OA/" + capuuid + "/",
})); httpMethod => ProcessAdd(httpMethod, agentID, caps),
"ObjectAdd",
agentID.ToString()));;
} }
public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap) public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap)

View File

@ -106,12 +106,15 @@ namespace OpenSim.Region.ClientStack.Linden
UUID capID = UUID.Random(); UUID capID = UUID.Random();
// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID); // m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
caps.RegisterHandler("UploadObjectAsset", caps.RegisterHandler(
new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", "UploadObjectAsset",
delegate(Hashtable m_dhttpMethod) new RestHTTPHandler(
{ "POST",
return ProcessAdd(m_dhttpMethod, agentID, caps); "/CAPS/OA/" + capID + "/",
})); httpMethod => ProcessAdd(httpMethod, agentID, caps),
"UploadObjectAsset",
agentID.ToString()));
/* /*
caps.RegisterHandler("NewFileAgentInventoryVariablePrice", caps.RegisterHandler("NewFileAgentInventoryVariablePrice",

View File

@ -154,7 +154,9 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
IRequestHandler reqHandler IRequestHandler reqHandler
= new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), HandleSimulatorFeaturesRequest); = new RestHTTPHandler(
"GET", "/CAPS/" + UUID.Random(),
HandleSimulatorFeaturesRequest, "SimulatorFeatures", agentID.ToString());
caps.RegisterHandler("SimulatorFeatures", reqHandler); caps.RegisterHandler("SimulatorFeatures", reqHandler);
} }

View File

@ -106,7 +106,9 @@ namespace OpenSim.Region.ClientStack.Linden
"POST", "POST",
"/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
new UploadBakedTextureHandler( new UploadBakedTextureHandler(
caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture,
"UploadBakedTexture",
agentID.ToString()));
} }
} }
} }

View File

@ -144,7 +144,12 @@ namespace OpenSim.Region.ClientStack.Linden
capUrl = "/CAPS/" + UUID.Random(); capUrl = "/CAPS/" + UUID.Random();
IRequestHandler reqHandler IRequestHandler reqHandler
= new RestStreamHandler("POST", capUrl, m_webFetchHandler.FetchInventoryDescendentsRequest); = new RestStreamHandler(
"POST",
capUrl,
m_webFetchHandler.FetchInventoryDescendentsRequest,
"FetchInventoryDescendents2",
agentID.ToString());
caps.RegisterHandler(capName, reqHandler); caps.RegisterHandler(capName, reqHandler);
} }
@ -160,4 +165,4 @@ namespace OpenSim.Region.ClientStack.Linden
// capName, capUrl, m_scene.RegionInfo.RegionName, agentID); // capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
} }
} }
} }

View File

@ -1433,21 +1433,26 @@ namespace OpenSim.Region.CoreModules.World.Land
private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
{ {
string capsBase = "/CAPS/" + caps.CapsObjectPath; string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("RemoteParcelRequest", caps.RegisterHandler(
new RestStreamHandler("POST", capsBase + remoteParcelRequestPath, "RemoteParcelRequest",
delegate(string request, string path, string param, new RestStreamHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "POST",
{ capsBase + remoteParcelRequestPath,
return RemoteParcelRequest(request, path, param, agentID, caps); (request, path, param, httpRequest, httpResponse)
})); => RemoteParcelRequest(request, path, param, agentID, caps),
"RemoteParcelRequest",
agentID.ToString()));
UUID parcelCapID = UUID.Random(); UUID parcelCapID = UUID.Random();
caps.RegisterHandler("ParcelPropertiesUpdate", caps.RegisterHandler(
new RestStreamHandler("POST", "/CAPS/" + parcelCapID, "ParcelPropertiesUpdate",
delegate(string request, string path, string param, new RestStreamHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "POST",
{ "/CAPS/" + parcelCapID,
return ProcessPropertiesUpdate(request, path, param, agentID, caps); (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) 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 // Even though we're registering for POST we're going to get GETS and UPDATES too
caps.RegisterHandler( caps.RegisterHandler(
"ObjectMedia", new RestStreamHandler("POST", omCapUrl, HandleObjectMediaMessage)); "ObjectMedia",
new RestStreamHandler(
"POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString()));
} }
string omuCapUrl = "/CAPS/" + UUID.Random(); 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 // Even though we're registering for POST we're going to get GETS and UPDATES too
caps.RegisterHandler( 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); //m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
string capsBase = "/CAPS/" + caps.CapsObjectPath; string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("MapLayer", caps.RegisterHandler(
new RestStreamHandler("POST", capsBase + m_mapLayerPath, "MapLayer",
delegate(string request, string path, string param, new RestStreamHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "POST",
{ capsBase + m_mapLayerPath,
return MapLayerRequest(request, path, param, (request, path, param, httpRequest, httpResponse)
agentID, caps); => MapLayerRequest(request, path, param, agentID, caps),
})); "MapLayer",
agentID.ToString()));
} }
/// <summary> /// <summary>

View File

@ -48,16 +48,19 @@ namespace OpenSim.Region.Framework.Scenes
{ {
public class RegionStatsHandler : IStreamedRequestHandler public class RegionStatsHandler : IStreamedRequestHandler
{ {
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string osRXStatsURI = String.Empty; private string osRXStatsURI = String.Empty;
private string osXStatsURI = String.Empty; private string osXStatsURI = String.Empty;
//private string osSecret = String.Empty; //private string osSecret = String.Empty;
private OpenSim.Framework.RegionInfo regionInfo; private OpenSim.Framework.RegionInfo regionInfo;
public string localZone = TimeZone.CurrentTimeZone.StandardName; public string localZone = TimeZone.CurrentTimeZone.StandardName;
public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public RegionStatsHandler(OpenSim.Framework.RegionInfo region_info) public string Name { get { return "RegionStats"; } }
public string Description { get { return "Region Statistics"; } }
public RegionStatsHandler(RegionInfo region_info)
{ {
regionInfo = region_info; regionInfo = region_info;
osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret); osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);

View File

@ -306,30 +306,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
agentID, caps, scene.RegionInfo.RegionName); agentID, caps, scene.RegionInfo.RegionName);
string capsBase = "/CAPS/" + caps.CapsObjectPath; string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("ProvisionVoiceAccountRequest", caps.RegisterHandler(
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, "ProvisionVoiceAccountRequest",
delegate(string request, string path, string param, new RestStreamHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "POST",
{ capsBase + m_provisionVoiceAccountRequestPath,
return ProvisionVoiceAccountRequest(scene, request, path, param, (request, path, param, httpRequest, httpResponse)
agentID, caps); => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps),
})); "ProvisionVoiceAccountRequest",
caps.RegisterHandler("ParcelVoiceInfoRequest", agentID.ToString()));
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath,
delegate(string request, string path, string param, caps.RegisterHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "ParcelVoiceInfoRequest",
{ new RestStreamHandler(
return ParcelVoiceInfoRequest(scene, request, path, param, "POST",
agentID, caps); capsBase + m_parcelVoiceInfoRequestPath,
})); (request, path, param, httpRequest, httpResponse)
caps.RegisterHandler("ChatSessionRequest", => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps),
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, "ParcelVoiceInfoRequest",
delegate(string request, string path, string param, agentID.ToString()));
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ caps.RegisterHandler(
return ChatSessionRequest(scene, request, path, param, "ChatSessionRequest",
agentID, caps); new RestStreamHandler(
})); "POST",
capsBase + m_chatSessionRequestPath,
(request, path, param, httpRequest, httpResponse)
=> ChatSessionRequest(scene, request, path, param, agentID, caps),
"ChatSessionRequest",
agentID.ToString()));
} }
/// <summary> /// <summary>

View File

@ -406,30 +406,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
m_log.DebugFormat("[VivoxVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); m_log.DebugFormat("[VivoxVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
string capsBase = "/CAPS/" + caps.CapsObjectPath; string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("ProvisionVoiceAccountRequest",
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, caps.RegisterHandler(
delegate(string request, string path, string param, "ProvisionVoiceAccountRequest",
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) new RestStreamHandler(
{ "POST",
return ProvisionVoiceAccountRequest(scene, request, path, param, capsBase + m_provisionVoiceAccountRequestPath,
agentID, caps); (request, path, param, httpRequest, httpResponse)
})); => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps),
caps.RegisterHandler("ParcelVoiceInfoRequest", "ProvisionVoiceAccountRequest",
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, agentID.ToString()));
delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) caps.RegisterHandler(
{ "ParcelVoiceInfoRequest",
return ParcelVoiceInfoRequest(scene, request, path, param, new RestStreamHandler(
agentID, caps); "POST",
})); capsBase + m_parcelVoiceInfoRequestPath,
caps.RegisterHandler("ChatSessionRequest", (request, path, param, httpRequest, httpResponse)
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps),
delegate(string request, string path, string param, "ParcelVoiceInfoRequest",
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) agentID.ToString()));
{
return ChatSessionRequest(scene, request, path, param, caps.RegisterHandler(
agentID, caps); "ChatSessionRequest",
})); new RestStreamHandler(
"POST",
capsBase + m_chatSessionRequestPath,
(request, path, param, httpRequest, httpResponse)
=> ChatSessionRequest(scene, request, path, param, agentID, caps),
"ChatSessionRequest",
agentID.ToString()));
} }
/// <summary> /// <summary>

View File

@ -282,14 +282,15 @@ namespace OpenSim.Region.UserStatistics
// m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); // m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
string capsPath = "/CAPS/VS/" + UUID.Random(); string capsPath = "/CAPS/VS/" + UUID.Random();
caps.RegisterHandler("ViewerStats", caps.RegisterHandler(
new RestStreamHandler("POST", capsPath, "ViewerStats",
delegate(string request, string path, string param, new RestStreamHandler(
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) "POST",
{ capsPath,
return ViewerStatsReport(request, path, param, (request, path, param, httpRequest, httpResponse)
agentID, caps); => ViewerStatsReport(request, path, param, agentID, caps),
})); "ViewerStats",
agentID.ToString()));
} }
private void OnDeRegisterCaps(UUID agentID, Caps caps) private void OnDeRegisterCaps(UUID agentID, Caps caps)

View File

@ -191,6 +191,8 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
#endregion HTML #endregion HTML
public string Name { get { return "OpenId"; } }
public string Description { get { return null; } }
public string ContentType { get { return m_contentType; } } public string ContentType { get { return m_contentType; } }
public string HttpMethod { get { return m_httpMethod; } } public string HttpMethod { get { return m_httpMethod; } }
public string Path { get { return m_path; } } public string Path { get { return m_path; } }