diff options
author | Justin Clark-Casey (justincc) | 2011-11-26 00:29:01 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-26 00:29:01 +0000 |
commit | 11c19b0d2ea97e82f3da3bb8fde665a25b044943 (patch) | |
tree | 32af9e4b0d17dfad0e5d4740ef66617d8748f7ee /OpenSim/Region | |
parent | Stop locking the requests coming in to WebFetchInvDecHandler. (diff) | |
download | opensim-SC_OLD-11c19b0d2ea97e82f3da3bb8fde665a25b044943.zip opensim-SC_OLD-11c19b0d2ea97e82f3da3bb8fde665a25b044943.tar.gz opensim-SC_OLD-11c19b0d2ea97e82f3da3bb8fde665a25b044943.tar.bz2 opensim-SC_OLD-11c19b0d2ea97e82f3da3bb8fde665a25b044943.tar.xz |
Use the same web fetch handler for every request from every avatar, since it contains no instance code
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 72177a8..10f43d1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
60 | private string m_fetchInventoryDescendents2Url; | 60 | private string m_fetchInventoryDescendents2Url; |
61 | private string m_webFetchInventoryDescendentsUrl; | 61 | private string m_webFetchInventoryDescendentsUrl; |
62 | 62 | ||
63 | private WebFetchInvDescHandler m_webFetchHandler; | ||
64 | |||
63 | #region ISharedRegionModule Members | 65 | #region ISharedRegionModule Members |
64 | 66 | ||
65 | public void Initialise(IConfigSource source) | 67 | public void Initialise(IConfigSource source) |
@@ -72,7 +74,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
72 | m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty); | 74 | m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty); |
73 | 75 | ||
74 | if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty) | 76 | if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty) |
77 | { | ||
75 | m_Enabled = true; | 78 | m_Enabled = true; |
79 | } | ||
76 | } | 80 | } |
77 | 81 | ||
78 | public void AddRegion(Scene s) | 82 | public void AddRegion(Scene s) |
@@ -97,8 +101,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
97 | if (!m_Enabled) | 101 | if (!m_Enabled) |
98 | return; | 102 | return; |
99 | 103 | ||
100 | m_InventoryService = m_scene.InventoryService; ; | 104 | m_InventoryService = m_scene.InventoryService; |
101 | m_LibraryService = m_scene.LibraryService; | 105 | m_LibraryService = m_scene.LibraryService; |
106 | |||
107 | // We'll reuse the same handler for all requests. | ||
108 | if (m_fetchInventoryDescendents2Url == "localhost" || m_webFetchInventoryDescendentsUrl == "localhost") | ||
109 | m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); | ||
110 | |||
102 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; | 111 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; |
103 | } | 112 | } |
104 | 113 | ||
@@ -134,9 +143,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
134 | { | 143 | { |
135 | capUrl = "/CAPS/" + UUID.Random(); | 144 | capUrl = "/CAPS/" + UUID.Random(); |
136 | 145 | ||
137 | WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); | ||
138 | IRequestHandler reqHandler | 146 | IRequestHandler reqHandler |
139 | = new RestStreamHandler("POST", capUrl, webFetchHandler.FetchInventoryDescendentsRequest); | 147 | = new RestStreamHandler("POST", capUrl, m_webFetchHandler.FetchInventoryDescendentsRequest); |
140 | 148 | ||
141 | caps.RegisterHandler(capName, reqHandler); | 149 | caps.RegisterHandler(capName, reqHandler); |
142 | } | 150 | } |