From 0af1d8fe196e403c066f7fc3dbc9f4b897b4da2c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 30 Apr 2013 23:35:59 +0200 Subject: Fix CAPS to work like they should - do not send caps to the viewer if they're not in the requested caps list. The previous wrong behavior caused the debug setting "UseHTTPInventory" to fail on all viewers when turned off. UDB inventory would not be correctly used in that case. --- .../ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 921d3bf..59b9585 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -355,11 +355,22 @@ namespace OpenSim.Region.ClientStack.Linden return string.Empty; } - Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true); + OSDArray capsRequested = (OSDArray)OSDParser.DeserializeLLSDXml(request); + List validCaps = new List(); + + foreach (OSD c in capsRequested) + validCaps.Add(c.AsString()); + + Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true, validCaps); // Add the external too foreach (KeyValuePair kvp in m_HostCapsObj.ExternalCapsHandlers) + { + if (!validCaps.Contains(kvp.Key)) + continue; + caps[kvp.Key] = kvp.Value; + } string result = LLSDHelpers.SerialiseLLSDReply(caps); -- cgit v1.1