diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs | 20 |
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 | ||
28 | using Mono.Addins; | 28 | using System; |
29 | using System.Collections; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
29 | using Nini.Config; | 32 | using Nini.Config; |
33 | using Mono.Addins; | ||
30 | using OpenMetaverse; | 34 | using OpenMetaverse; |
31 | using OpenSim.Capabilities.Handlers; | 35 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Servers.HttpServer; | 36 | using OpenSim.Framework.Servers.HttpServer; |
33 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
36 | using System; | ||
37 | using Caps = OpenSim.Framework.Capabilities.Caps; | 40 | using Caps = OpenSim.Framework.Capabilities.Caps; |
41 | using OpenSim.Capabilities.Handlers; | ||
38 | 42 | ||
39 | namespace OpenSim.Region.ClientStack.Linden | 43 | namespace 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 | } |