From b5ac0e1ab811626ef5e904d6f67689dbd33433bc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 23 Jun 2015 14:24:55 -0700 Subject: FetchInventoryDescendents2: Signal to the viewer that folder with UUID.Zero is a bad folder. Don't even go to the backend to ask for it, because that will likely kill the sim. Apparently Firestorm requests folder Zero quite often. --- .../FetchInventoryDescendents2HandlerTests.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'OpenSim/Capabilities/Handlers/FetchInventory/Tests') diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 380c54a..0b66835 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs @@ -262,6 +262,31 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests count = Regex.Matches(llsdresponse, notecards_folder).Count; Assert.AreEqual(2, count, "More than 1 notecards folder in response"); // Notecards will also be under root, so 2 } + + [Test] + public void Test_005_FolderZero() + { + TestHelpers.InMethod(); + + Init(); + + FetchInvDescHandler handler = new FetchInvDescHandler(m_scene.InventoryService, null, m_scene); + TestOSHttpRequest req = new TestOSHttpRequest(); + TestOSHttpResponse resp = new TestOSHttpResponse(); + + string request = "foldersfetch_folders1fetch_items1folder_id"; + request += UUID.Zero; + request += "owner_id00000000-0000-0000-0000-000000000000sort_order1"; + + string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); + + Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); + Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); + Assert.That(llsdresponse.Contains("bad_folders00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder"); + + Console.WriteLine(llsdresponse); + } + } } \ No newline at end of file -- cgit v1.1