diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 22 |
1 files changed, 15 insertions, 7 deletions
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 | |||
113 | // wrap this in a try block so that defaults will work if | 113 | // wrap this in a try block so that defaults will work if |
114 | // the config file doesn't specify otherwise. | 114 | // the config file doesn't specify otherwise. |
115 | int maxlisteners = 1000; | 115 | int maxlisteners = 1000; |
116 | int maxhandles = 64; | 116 | int maxhandles = 65; |
117 | try | 117 | try |
118 | { | 118 | { |
119 | m_whisperdistance = config.Configs["Chat"].GetInt( | 119 | m_whisperdistance = config.Configs["Chat"].GetInt( |
@@ -130,8 +130,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
130 | catch (Exception) | 130 | catch (Exception) |
131 | { | 131 | { |
132 | } | 132 | } |
133 | if (maxlisteners < 1) maxlisteners = int.MaxValue; | 133 | |
134 | if (maxhandles < 1) maxhandles = int.MaxValue; | 134 | if (maxlisteners < 1) |
135 | maxlisteners = int.MaxValue; | ||
136 | if (maxhandles < 1) | ||
137 | maxhandles = int.MaxValue; | ||
138 | |||
139 | if (maxlisteners < maxhandles) | ||
140 | maxlisteners = maxhandles; | ||
141 | |||
135 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); | 142 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); |
136 | m_pendingQ = new Queue(); | 143 | m_pendingQ = new Queue(); |
137 | m_pending = Queue.Synchronized(m_pendingQ); | 144 | m_pending = Queue.Synchronized(m_pendingQ); |
@@ -605,11 +612,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
605 | li.GetHandle().Equals(handle)) | 612 | li.GetHandle().Equals(handle)) |
606 | { | 613 | { |
607 | lis.Value.Remove(li); | 614 | lis.Value.Remove(li); |
615 | m_curlisteners--; | ||
608 | if (lis.Value.Count == 0) | 616 | if (lis.Value.Count == 0) |
609 | { | 617 | m_listeners.Remove(lis.Key); // bailing of loop so this does not smoke |
610 | m_listeners.Remove(lis.Key); | ||
611 | m_curlisteners--; | ||
612 | } | ||
613 | // there should be only one, so we bail out early | 618 | // there should be only one, so we bail out early |
614 | return; | 619 | return; |
615 | } | 620 | } |
@@ -718,6 +723,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
718 | } | 723 | } |
719 | } | 724 | } |
720 | 725 | ||
726 | if(handles.Count >= m_maxhandles) | ||
727 | return -1; | ||
728 | |||
721 | // Note: 0 is NOT a valid handle for llListen() to return | 729 | // Note: 0 is NOT a valid handle for llListen() to return |
722 | for (int i = 1; i <= m_maxhandles; i++) | 730 | for (int i = 1; i <= m_maxhandles; i++) |
723 | { | 731 | { |