From 1491ba3500bc954a496296f62d619c75c3942971 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 24 Sep 2014 16:01:25 +0100 Subject: [PATCH] change melanies patch, reusing caps if circuit and caps path is the same. Do the aditional cleanup, if the path did change --- .../Framework/Caps/CapabilitiesModule.cs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 88447f30da..36a94513ad 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs @@ -139,21 +139,25 @@ namespace OpenSim.Region.CoreModules.Framework { Caps oldCaps = m_capsObjects[circuitCode]; - // Remove tge handlers. They may conflict with the - // new object created below - oldCaps.DeregisterHandlers(); - // Better safe ... should not be needed but also - // no big deal - m_capsObjects.Remove(circuitCode); + if (capsObjectPath == oldCaps.CapsObjectPath) + { + m_log.WarnFormat( + "[CAPS]: Reusing caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", + agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); + return; + } + else + { + // not reusing add extra melanie cleanup + // Remove tge handlers. They may conflict with the + // new object created below + oldCaps.DeregisterHandlers(); -// if (capsObjectPath == oldCaps.CapsObjectPath) -// { -// m_log.WarnFormat( -// "[CAPS]: Reusing caps for agent {0} in region {1}. Old caps path {2}, new caps path {3}. ", -// agentId, m_scene.RegionInfo.RegionName, oldCaps.CapsObjectPath, capsObjectPath); -// return; -// } + // Better safe ... should not be needed but also + // no big deal + m_capsObjects.Remove(circuitCode); + } } caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName,