From 710677cdc6afef7f67f700bf4efcf145d23b85d5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 2 May 2017 15:16:56 +0100 Subject: mantis 8135 --- .../Scripting/WorldComm/WorldCommModule.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 660e03f..a5203ea 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm // wrap this in a try block so that defaults will work if // the config file doesn't specify otherwise. int maxlisteners = 1000; - int maxhandles = 64; + int maxhandles = 65; try { m_whisperdistance = config.Configs["Chat"].GetInt( @@ -130,8 +130,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm catch (Exception) { } - if (maxlisteners < 1) maxlisteners = int.MaxValue; - if (maxhandles < 1) maxhandles = int.MaxValue; + + if (maxlisteners < 1) + maxlisteners = int.MaxValue; + if (maxhandles < 1) + maxhandles = int.MaxValue; + + if (maxlisteners < maxhandles) + maxlisteners = maxhandles; + m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_pendingQ = new Queue(); m_pending = Queue.Synchronized(m_pendingQ); @@ -605,11 +612,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm li.GetHandle().Equals(handle)) { lis.Value.Remove(li); + m_curlisteners--; if (lis.Value.Count == 0) - { - m_listeners.Remove(lis.Key); - m_curlisteners--; - } + m_listeners.Remove(lis.Key); // bailing of loop so this does not smoke // there should be only one, so we bail out early return; } @@ -718,6 +723,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm } } + if(handles.Count >= m_maxhandles) + return -1; + // Note: 0 is NOT a valid handle for llListen() to return for (int i = 1; i <= m_maxhandles; i++) { -- cgit v1.1