aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
index e0a11cc..87d3d1c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
@@ -25,16 +25,20 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Mono.Addins; 28using System;
29using System.Collections;
30using System.Reflection;
31using log4net;
29using Nini.Config; 32using Nini.Config;
33using Mono.Addins;
30using OpenMetaverse; 34using OpenMetaverse;
31using OpenSim.Capabilities.Handlers; 35using OpenSim.Framework;
32using OpenSim.Framework.Servers.HttpServer; 36using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
35using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
36using System;
37using Caps = OpenSim.Framework.Capabilities.Caps; 40using Caps = OpenSim.Framework.Capabilities.Caps;
41using OpenSim.Capabilities.Handlers;
38 42
39namespace OpenSim.Region.ClientStack.Linden 43namespace OpenSim.Region.ClientStack.Linden
40{ 44{
@@ -54,6 +58,8 @@ namespace OpenSim.Region.ClientStack.Linden
54 58
55 private string m_fetchInventory2Url; 59 private string m_fetchInventory2Url;
56 60
61 private FetchInventory2Handler m_fetchHandler;
62
57 #region ISharedRegionModule Members 63 #region ISharedRegionModule Members
58 64
59 public void Initialise(IConfigSource source) 65 public void Initialise(IConfigSource source)
@@ -92,6 +98,10 @@ namespace OpenSim.Region.ClientStack.Linden
92 98
93 m_inventoryService = m_scene.InventoryService; 99 m_inventoryService = m_scene.InventoryService;
94 100
101 // We'll reuse the same handler for all requests.
102 if (m_fetchInventory2Url == "localhost")
103 m_fetchHandler = new FetchInventory2Handler(m_inventoryService);
104
95 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 105 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
96 } 106 }
97 107
@@ -121,11 +131,9 @@ namespace OpenSim.Region.ClientStack.Linden
121 { 131 {
122 capUrl = "/CAPS/" + UUID.Random(); 132 capUrl = "/CAPS/" + UUID.Random();
123 133
124 FetchInventory2Handler fetchHandler = new FetchInventory2Handler(m_inventoryService, agentID);
125
126 IRequestHandler reqHandler 134 IRequestHandler reqHandler
127 = new RestStreamHandler( 135 = new RestStreamHandler(
128 "POST", capUrl, fetchHandler.FetchInventoryRequest, capName, agentID.ToString()); 136 "POST", capUrl, m_fetchHandler.FetchInventoryRequest, capName, agentID.ToString());
129 137
130 caps.RegisterHandler(capName, reqHandler); 138 caps.RegisterHandler(capName, reqHandler);
131 } 139 }