aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers/FetchInventory
diff options
context:
space:
mode:
authorDiva Canto2015-06-03 17:42:41 -0700
committerDiva Canto2015-06-03 17:42:41 -0700
commitbac53387a9868f3765175179aecd3b97981d54a0 (patch)
tree68856ca9441d200d5ef83d7d616fdb9a94b91473 /OpenSim/Capabilities/Handlers/FetchInventory
parentI suspect the viewer doesn't need the target of linked items inside linked fo... (diff)
downloadopensim-SC_OLD-bac53387a9868f3765175179aecd3b97981d54a0.zip
opensim-SC_OLD-bac53387a9868f3765175179aecd3b97981d54a0.tar.gz
opensim-SC_OLD-bac53387a9868f3765175179aecd3b97981d54a0.tar.bz2
opensim-SC_OLD-bac53387a9868f3765175179aecd3b97981d54a0.tar.xz
Mantis #7567: added an 8-sec expiring item cache to the inventory network connector. This fixed the problem on my local test grid and generally made things faster. This cache has been needed for a while... there are many parts in the code where the sim gets an item multiple times in a short amount of time (rezzing attachs and objects, for example).
Other minor changes: - added the scene as a parameter to the constructor od FetchInvDescHandler, so that I could see in which scene the handler was being called - brought linked items in linked folders back to being prefetched
Diffstat (limited to 'OpenSim/Capabilities/Handlers/FetchInventory')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs35
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescServerConnector.cs2
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs2
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs8
4 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 1b7d3f5..62ca8a3 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -50,18 +50,21 @@ namespace OpenSim.Capabilities.Handlers
50 50
51 private IInventoryService m_InventoryService; 51 private IInventoryService m_InventoryService;
52 private ILibraryService m_LibraryService; 52 private ILibraryService m_LibraryService;
53 private IScene m_Scene;
53// private object m_fetchLock = new Object(); 54// private object m_fetchLock = new Object();
54 55
55 public FetchInvDescHandler(IInventoryService invService, ILibraryService libService) 56 public FetchInvDescHandler(IInventoryService invService, ILibraryService libService, IScene s)
56 { 57 {
57 m_InventoryService = invService; 58 m_InventoryService = invService;
58 m_LibraryService = libService; 59 m_LibraryService = libService;
60 m_Scene = s;
59 } 61 }
60 62
61 63
62 public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 64 public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
63 { 65 {
64 66 //m_log.DebugFormat("[XXX]: FetchInventoryDescendentsRequest in {0}, {1}", (m_Scene == null) ? "none" : m_Scene.Name, request);
67
65 // nasty temporary hack here, the linden client falsely 68 // nasty temporary hack here, the linden client falsely
66 // identifies the uuid 00000000-0000-0000-0000-000000000000 69 // identifies the uuid 00000000-0000-0000-0000-000000000000
67 // as a string which breaks us 70 // as a string which breaks us
@@ -725,20 +728,20 @@ namespace OpenSim.Capabilities.Handlers
725 728
726 itemsToReturn.InsertRange(0, links); 729 itemsToReturn.InsertRange(0, links);
727 730
728 //foreach (InventoryItemBase link in linkedFolderContents.Items) 731 foreach (InventoryItemBase link in linkedFolderContents.Items)
729 //{ 732 {
730 // // Take care of genuinely broken links where the target doesn't exist 733 // Take care of genuinely broken links where the target doesn't exist
731 // // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, 734 // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
732 // // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles 735 // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
733 // // rather than having to keep track of every folder requested in the recursion. 736 // rather than having to keep track of every folder requested in the recursion.
734 // if (link != null && link.AssetType == (int)AssetType.Link) 737 if (link != null && link.AssetType == (int)AssetType.Link)
735 // { 738 {
736 // //m_log.DebugFormat( 739 //m_log.DebugFormat(
737 // // "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3} ({4} {5})", 740 // "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3} ({4} {5})",
738 // // link.Name, (AssetType)link.AssetType, linkedFolderContents.FolderID, contents.FolderID, link.ID, link.AssetID); 741 // link.Name, (AssetType)link.AssetType, linkedFolderContents.FolderID, contents.FolderID, link.ID, link.AssetID);
739 // itemIDs.Add(link.AssetID); 742 itemIDs.Add(link.AssetID);
740 // } 743 }
741 //} 744 }
742 } 745 }
743 } 746 }
744 747
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescServerConnector.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescServerConnector.cs
index 6fbe173..9dcfaa4 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescServerConnector.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Capabilities.Handlers
67 m_LibraryService = 67 m_LibraryService =
68 ServerUtils.LoadPlugin<ILibraryService>(libService, args); 68 ServerUtils.LoadPlugin<ILibraryService>(libService, args);
69 69
70 FetchInvDescHandler webFetchHandler = new FetchInvDescHandler(m_InventoryService, m_LibraryService); 70 FetchInvDescHandler webFetchHandler = new FetchInvDescHandler(m_InventoryService, m_LibraryService, null);
71 IRequestHandler reqHandler 71 IRequestHandler reqHandler
72 = new RestStreamHandler( 72 = new RestStreamHandler(
73 "POST", 73 "POST",
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs
index 0832b02..c904392 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Capabilities.Handlers
54 54
55 public string FetchInventoryRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 55 public string FetchInventoryRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
56 { 56 {
57// m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capabilty request"); 57 //m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capability request {0}", request);
58 58
59 OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request)); 59 OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request));
60 OSDArray itemsRequested = (OSDArray)requestmap["items"]; 60 OSDArray itemsRequested = (OSDArray)requestmap["items"];
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
index 056b4db..380c54a 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
133 133
134 Init(); 134 Init();
135 135
136 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null); 136 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene);
137 TestOSHttpRequest req = new TestOSHttpRequest(); 137 TestOSHttpRequest req = new TestOSHttpRequest();
138 TestOSHttpResponse resp = new TestOSHttpResponse(); 138 TestOSHttpResponse resp = new TestOSHttpResponse();
139 139
@@ -157,7 +157,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
157 { 157 {
158 TestHelpers.InMethod(); 158 TestHelpers.InMethod();
159 159
160 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null); 160 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene);
161 TestOSHttpRequest req = new TestOSHttpRequest(); 161 TestOSHttpRequest req = new TestOSHttpRequest();
162 TestOSHttpResponse resp = new TestOSHttpResponse(); 162 TestOSHttpResponse resp = new TestOSHttpResponse();
163 163
@@ -187,7 +187,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
187 { 187 {
188 TestHelpers.InMethod(); 188 TestHelpers.InMethod();
189 189
190 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null); 190 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene);
191 TestOSHttpRequest req = new TestOSHttpRequest(); 191 TestOSHttpRequest req = new TestOSHttpRequest();
192 TestOSHttpResponse resp = new TestOSHttpResponse(); 192 TestOSHttpResponse resp = new TestOSHttpResponse();
193 193
@@ -230,7 +230,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests
230 { 230 {
231 TestHelpers.InMethod(); 231 TestHelpers.InMethod();
232 232
233 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null); 233 FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene);
234 TestOSHttpRequest req = new TestOSHttpRequest(); 234 TestOSHttpRequest req = new TestOSHttpRequest();
235 TestOSHttpResponse resp = new TestOSHttpResponse(); 235 TestOSHttpResponse resp = new TestOSHttpResponse();
236 236