From b07c188b7e4793c50e1169b0b3c2e08cce33664f Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Tue, 6 Jan 2009 14:37:39 +0000
Subject: * refactor: call AddStreamHandler() directly via CommsManager
---
.../Modules/Hypergrid/HGStandaloneAssetService.cs | 8 +++----
.../Hypergrid/HGStandaloneInventoryService.cs | 26 ++++++++++------------
OpenSim/Region/Environment/Scenes/Scene.cs | 10 ---------
3 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs
index d090052..a5b45ea 100644
--- a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs
+++ b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs
@@ -120,13 +120,13 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid
protected void AddHttpHandlers(Scene m_scene)
{
IAssetProviderPlugin m_assetProvider = ((AssetServerBase)m_scene.AssetCache.AssetServer).AssetProviderPlugin;
-
- m_scene.AddStreamHandler(new GetAssetStreamHandler(m_assetProvider));
- m_scene.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider));
+
+ BaseHttpServer httpServer = m_scene.CommsManager.HttpServer;
+ httpServer.AddStreamHandler(new GetAssetStreamHandler(m_assetProvider));
+ httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider));
}
-
/////
///// Check that the source of an inventory request is one that we trust.
/////
diff --git a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneInventoryService.cs b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneInventoryService.cs
index bfdbcfc..b10582b 100644
--- a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneInventoryService.cs
+++ b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneInventoryService.cs
@@ -30,12 +30,9 @@ using System;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
-
using log4net;
using Nini.Config;
-
using OpenMetaverse;
-
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
@@ -93,11 +90,13 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid
}
#endregion
-
}
public class InventoryService
{
+ private static readonly ILog m_log
+ = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
private InventoryServiceBase m_inventoryService;
private IUserService m_userService;
private bool m_doLookup = false;
@@ -107,44 +106,43 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid
get { return m_doLookup; }
set { m_doLookup = value; }
}
- private static readonly ILog m_log
- = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InventoryService(Scene m_scene)
{
m_inventoryService = (InventoryServiceBase)m_scene.CommsManager.SecureInventoryService;
m_userService = m_scene.CommsManager.UserService;
AddHttpHandlers(m_scene);
-
}
protected void AddHttpHandlers(Scene m_scene)
{
- m_scene.AddStreamHandler(
+ BaseHttpServer httpServer = m_scene.CommsManager.HttpServer;
+
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/GetInventory/", GetUserInventory, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/NewFolder/", m_inventoryService.AddFolder, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/UpdateFolder/", m_inventoryService.UpdateFolder, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/MoveFolder/", m_inventoryService.MoveFolder, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/PurgeFolder/", m_inventoryService.PurgeFolder, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/NewItem/", m_inventoryService.AddItem, CheckAuthSession));
- m_scene.AddStreamHandler(
+ httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler(
"POST", "/DeleteItem/", m_inventoryService.DeleteItem, CheckAuthSession));
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ac1461e..d6b3f0e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -4185,16 +4185,6 @@ namespace OpenSim.Region.Environment.Scenes
return m_httpListener.AddHTTPHandler(method, handler);
}
- public void AddStreamHandler(IRequestHandler handler)
- {
- m_httpListener.AddStreamHandler(handler);
- }
-
- public void RemoveStreamHandler(string httpMethod, string path)
- {
- m_httpListener.RemoveStreamHandler(httpMethod, path);
- }
-
public void RemoveHTTPHandler(string httpMethod, string path)
{
m_httpListener.RemoveHTTPHandler(httpMethod, path);
--
cgit v1.1