From 53100b93c7c13f42e59c4133e6bb72cb20299899 Mon Sep 17 00:00:00 2001 From: Freaky Tech Date: Tue, 3 Mar 2015 22:46:25 +0100 Subject: corrected bug that viewer cannot correctly fetch ItemData when being a HG visitor Signed-off-by: BlueWall --- .../ClientStack/Linden/Caps/FetchInventory2Module.cs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs index 87d3d1c..e0a11cc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs @@ -25,20 +25,16 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; -using System.Collections; -using System.Reflection; -using log4net; -using Nini.Config; using Mono.Addins; +using Nini.Config; using OpenMetaverse; -using OpenSim.Framework; +using OpenSim.Capabilities.Handlers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; +using System; using Caps = OpenSim.Framework.Capabilities.Caps; -using OpenSim.Capabilities.Handlers; namespace OpenSim.Region.ClientStack.Linden { @@ -58,8 +54,6 @@ namespace OpenSim.Region.ClientStack.Linden private string m_fetchInventory2Url; - private FetchInventory2Handler m_fetchHandler; - #region ISharedRegionModule Members public void Initialise(IConfigSource source) @@ -98,10 +92,6 @@ namespace OpenSim.Region.ClientStack.Linden m_inventoryService = m_scene.InventoryService; - // We'll reuse the same handler for all requests. - if (m_fetchInventory2Url == "localhost") - m_fetchHandler = new FetchInventory2Handler(m_inventoryService); - m_scene.EventManager.OnRegisterCaps += RegisterCaps; } @@ -131,9 +121,11 @@ namespace OpenSim.Region.ClientStack.Linden { capUrl = "/CAPS/" + UUID.Random(); + FetchInventory2Handler fetchHandler = new FetchInventory2Handler(m_inventoryService, agentID); + IRequestHandler reqHandler = new RestStreamHandler( - "POST", capUrl, m_fetchHandler.FetchInventoryRequest, capName, agentID.ToString()); + "POST", capUrl, fetchHandler.FetchInventoryRequest, capName, agentID.ToString()); caps.RegisterHandler(capName, reqHandler); } -- cgit v1.1