diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/ChecksManager.cs | 45 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 54 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 16 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 6 |
7 files changed, 64 insertions, 67 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c046010..cafbd1f 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -117,7 +117,7 @@ namespace OpenSim.Framework | |||
117 | 117 | ||
118 | public delegate void ObjectExtraParams(UUID agentID, uint localID, ushort type, bool inUse, byte[] data); | 118 | public delegate void ObjectExtraParams(UUID agentID, uint localID, ushort type, bool inUse, byte[] data); |
119 | 119 | ||
120 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | 120 | public delegate void ObjectSelect(List<uint> localID, IClientAPI remoteClient); |
121 | 121 | ||
122 | public delegate void ObjectRequest(uint localID, IClientAPI remoteClient); | 122 | public delegate void ObjectRequest(uint localID, IClientAPI remoteClient); |
123 | 123 | ||
@@ -1382,6 +1382,8 @@ namespace OpenSim.Framework | |||
1382 | 1382 | ||
1383 | void SendObjectPropertiesReply(ISceneEntity Entity); | 1383 | void SendObjectPropertiesReply(ISceneEntity Entity); |
1384 | 1384 | ||
1385 | void SendSelectedPartsProprieties(List<ISceneEntity> parts); | ||
1386 | |||
1385 | void SendPartPhysicsProprieties(ISceneEntity Entity); | 1387 | void SendPartPhysicsProprieties(ISceneEntity Entity); |
1386 | 1388 | ||
1387 | void SendAgentOffline(UUID[] agentIDs); | 1389 | void SendAgentOffline(UUID[] agentIDs); |
diff --git a/OpenSim/Framework/Monitoring/ChecksManager.cs b/OpenSim/Framework/Monitoring/ChecksManager.cs index e4a7f8c..ff3b041 100644 --- a/OpenSim/Framework/Monitoring/ChecksManager.cs +++ b/OpenSim/Framework/Monitoring/ChecksManager.cs | |||
@@ -132,8 +132,8 @@ namespace OpenSim.Framework.Monitoring | |||
132 | /// <returns></returns> | 132 | /// <returns></returns> |
133 | public static bool RegisterCheck(Check check) | 133 | public static bool RegisterCheck(Check check) |
134 | { | 134 | { |
135 | SortedDictionary<string, SortedDictionary<string, Check>> category = null, newCategory; | 135 | SortedDictionary<string, SortedDictionary<string, Check>> category = null; |
136 | SortedDictionary<string, Check> container = null, newContainer; | 136 | SortedDictionary<string, Check> container = null; |
137 | 137 | ||
138 | lock (RegisteredChecks) | 138 | lock (RegisteredChecks) |
139 | { | 139 | { |
@@ -146,19 +146,15 @@ namespace OpenSim.Framework.Monitoring | |||
146 | // We take a copy-on-write approach here of replacing dictionaries when keys are added or removed. | 146 | // We take a copy-on-write approach here of replacing dictionaries when keys are added or removed. |
147 | // This means that we don't need to lock or copy them on iteration, which will be a much more | 147 | // This means that we don't need to lock or copy them on iteration, which will be a much more |
148 | // common operation after startup. | 148 | // common operation after startup. |
149 | if (container != null) | 149 | if (container == null) |
150 | newContainer = new SortedDictionary<string, Check>(container); | 150 | container = new SortedDictionary<string, Check>(); |
151 | else | ||
152 | newContainer = new SortedDictionary<string, Check>(); | ||
153 | 151 | ||
154 | if (category != null) | 152 | if (category == null) |
155 | newCategory = new SortedDictionary<string, SortedDictionary<string, Check>>(category); | 153 | category = new SortedDictionary<string, SortedDictionary<string, Check>>(); |
156 | else | ||
157 | newCategory = new SortedDictionary<string, SortedDictionary<string, Check>>(); | ||
158 | 154 | ||
159 | newContainer[check.ShortName] = check; | 155 | container[check.ShortName] = check; |
160 | newCategory[check.Container] = newContainer; | 156 | category[check.Container] = container; |
161 | RegisteredChecks[check.Category] = newCategory; | 157 | RegisteredChecks[check.Category] = category; |
162 | } | 158 | } |
163 | 159 | ||
164 | return true; | 160 | return true; |
@@ -171,23 +167,24 @@ namespace OpenSim.Framework.Monitoring | |||
171 | /// <returns></returns> | 167 | /// <returns></returns> |
172 | public static bool DeregisterCheck(Check check) | 168 | public static bool DeregisterCheck(Check check) |
173 | { | 169 | { |
174 | SortedDictionary<string, SortedDictionary<string, Check>> category = null, newCategory; | 170 | SortedDictionary<string, SortedDictionary<string, Check>> category = null; |
175 | SortedDictionary<string, Check> container = null, newContainer; | 171 | SortedDictionary<string, Check> container = null; |
176 | 172 | ||
177 | lock (RegisteredChecks) | 173 | lock (RegisteredChecks) |
178 | { | 174 | { |
179 | if (!TryGetCheckParents(check, out category, out container)) | 175 | if (!TryGetCheckParents(check, out category, out container)) |
180 | return false; | 176 | return false; |
181 | 177 | ||
182 | newContainer = new SortedDictionary<string, Check>(container); | 178 | if(container != null) |
183 | newContainer.Remove(check.ShortName); | 179 | { |
184 | 180 | container.Remove(check.ShortName); | |
185 | newCategory = new SortedDictionary<string, SortedDictionary<string, Check>>(category); | 181 | if(category != null && container.Count == 0) |
186 | newCategory.Remove(check.Container); | 182 | { |
187 | 183 | category.Remove(check.Container); | |
188 | newCategory[check.Container] = newContainer; | 184 | if(category.Count == 0) |
189 | RegisteredChecks[check.Category] = newCategory; | 185 | RegisteredChecks.Remove(check.Category); |
190 | 186 | } | |
187 | } | ||
191 | return true; | 188 | return true; |
192 | } | 189 | } |
193 | } | 190 | } |
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 8787ea0..30926d8 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -80,8 +80,7 @@ namespace OpenSim.Framework.Monitoring | |||
80 | + "'all' will show all statistics.\n" | 80 | + "'all' will show all statistics.\n" |
81 | + "A <category> name will show statistics from that category.\n" | 81 | + "A <category> name will show statistics from that category.\n" |
82 | + "A <category>.<container> name will show statistics from that category in that container.\n" | 82 | + "A <category>.<container> name will show statistics from that category in that container.\n" |
83 | + "More than one name can be given separated by spaces.\n" | 83 | + "More than one name can be given separated by spaces.\n", |
84 | + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS", | ||
85 | HandleShowStatsCommand); | 84 | HandleShowStatsCommand); |
86 | 85 | ||
87 | console.Commands.AddCommand( | 86 | console.Commands.AddCommand( |
@@ -91,7 +90,6 @@ namespace OpenSim.Framework.Monitoring | |||
91 | "show stats [list|all|(<category>[.<container>])+", | 90 | "show stats [list|all|(<category>[.<container>])+", |
92 | "Alias for 'stats show' command", | 91 | "Alias for 'stats show' command", |
93 | HandleShowStatsCommand); | 92 | HandleShowStatsCommand); |
94 | |||
95 | StatsLogger.RegisterConsoleCommands(console); | 93 | StatsLogger.RegisterConsoleCommands(console); |
96 | } | 94 | } |
97 | 95 | ||
@@ -361,8 +359,8 @@ namespace OpenSim.Framework.Monitoring | |||
361 | /// <returns></returns> | 359 | /// <returns></returns> |
362 | public static bool RegisterStat(Stat stat) | 360 | public static bool RegisterStat(Stat stat) |
363 | { | 361 | { |
364 | SortedDictionary<string, SortedDictionary<string, Stat>> category = null, newCategory; | 362 | SortedDictionary<string, SortedDictionary<string, Stat>> category = null; |
365 | SortedDictionary<string, Stat> container = null, newContainer; | 363 | SortedDictionary<string, Stat> container = null; |
366 | 364 | ||
367 | lock (RegisteredStats) | 365 | lock (RegisteredStats) |
368 | { | 366 | { |
@@ -372,22 +370,15 @@ namespace OpenSim.Framework.Monitoring | |||
372 | if (TryGetStatParents(stat, out category, out container)) | 370 | if (TryGetStatParents(stat, out category, out container)) |
373 | return false; | 371 | return false; |
374 | 372 | ||
375 | // We take a copy-on-write approach here of replacing dictionaries when keys are added or removed. | 373 | if (container == null) |
376 | // This means that we don't need to lock or copy them on iteration, which will be a much more | 374 | container = new SortedDictionary<string, Stat>(); |
377 | // common operation after startup. | ||
378 | if (container != null) | ||
379 | newContainer = new SortedDictionary<string, Stat>(container); | ||
380 | else | ||
381 | newContainer = new SortedDictionary<string, Stat>(); | ||
382 | 375 | ||
383 | if (category != null) | 376 | if (category == null) |
384 | newCategory = new SortedDictionary<string, SortedDictionary<string, Stat>>(category); | 377 | category = new SortedDictionary<string, SortedDictionary<string, Stat>>(); |
385 | else | ||
386 | newCategory = new SortedDictionary<string, SortedDictionary<string, Stat>>(); | ||
387 | 378 | ||
388 | newContainer[stat.ShortName] = stat; | 379 | container[stat.ShortName] = stat; |
389 | newCategory[stat.Container] = newContainer; | 380 | category[stat.Container] = container; |
390 | RegisteredStats[stat.Category] = newCategory; | 381 | RegisteredStats[stat.Category] = category; |
391 | } | 382 | } |
392 | 383 | ||
393 | return true; | 384 | return true; |
@@ -400,23 +391,24 @@ namespace OpenSim.Framework.Monitoring | |||
400 | /// <returns></returns> | 391 | /// <returns></returns> |
401 | public static bool DeregisterStat(Stat stat) | 392 | public static bool DeregisterStat(Stat stat) |
402 | { | 393 | { |
403 | SortedDictionary<string, SortedDictionary<string, Stat>> category = null, newCategory; | 394 | SortedDictionary<string, SortedDictionary<string, Stat>> category = null; |
404 | SortedDictionary<string, Stat> container = null, newContainer; | 395 | SortedDictionary<string, Stat> container = null; |
405 | 396 | ||
406 | lock (RegisteredStats) | 397 | lock (RegisteredStats) |
407 | { | 398 | { |
408 | if (!TryGetStatParents(stat, out category, out container)) | 399 | if (!TryGetStatParents(stat, out category, out container)) |
409 | return false; | 400 | return false; |
410 | 401 | ||
411 | newContainer = new SortedDictionary<string, Stat>(container); | 402 | if(container != null) |
412 | newContainer.Remove(stat.ShortName); | 403 | { |
413 | 404 | container.Remove(stat.ShortName); | |
414 | newCategory = new SortedDictionary<string, SortedDictionary<string, Stat>>(category); | 405 | if(category != null && container.Count == 0) |
415 | newCategory.Remove(stat.Container); | 406 | { |
416 | 407 | category.Remove(stat.Container); | |
417 | newCategory[stat.Container] = newContainer; | 408 | if(category.Count == 0) |
418 | RegisteredStats[stat.Category] = newCategory; | 409 | RegisteredStats.Remove(stat.Category); |
419 | 410 | } | |
411 | } | ||
420 | return true; | 412 | return true; |
421 | } | 413 | } |
422 | } | 414 | } |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index b2c1fb1..ff439f5 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -332,18 +332,18 @@ namespace OpenSim.Framework.Monitoring | |||
332 | if (callback != null) | 332 | if (callback != null) |
333 | { | 333 | { |
334 | List<ThreadWatchdogInfo> callbackInfos = null; | 334 | List<ThreadWatchdogInfo> callbackInfos = null; |
335 | List<ThreadWatchdogInfo> threadsInfo; | 335 | List<ThreadWatchdogInfo> threadsToRemove = null; |
336 | 336 | ||
337 | lock (m_threads) | 337 | lock (m_threads) |
338 | { | 338 | { |
339 | // get a copy since we may change m_threads | 339 | foreach(ThreadWatchdogInfo threadInfo in m_threads.Values) |
340 | threadsInfo = m_threads.Values.ToList(); | ||
341 | |||
342 | foreach(ThreadWatchdogInfo threadInfo in threadsInfo) | ||
343 | { | 340 | { |
344 | if(threadInfo.Thread.ThreadState == ThreadState.Stopped) | 341 | if(threadInfo.Thread.ThreadState == ThreadState.Stopped) |
345 | { | 342 | { |
346 | RemoveThread(threadInfo.Thread.ManagedThreadId); | 343 | if(threadsToRemove == null) |
344 | threadsToRemove = new List<ThreadWatchdogInfo>(); | ||
345 | |||
346 | threadsToRemove.Add(threadInfo); | ||
347 | 347 | ||
348 | if(callbackInfos == null) | 348 | if(callbackInfos == null) |
349 | callbackInfos = new List<ThreadWatchdogInfo>(); | 349 | callbackInfos = new List<ThreadWatchdogInfo>(); |
@@ -365,6 +365,10 @@ namespace OpenSim.Framework.Monitoring | |||
365 | } | 365 | } |
366 | } | 366 | } |
367 | } | 367 | } |
368 | |||
369 | if(threadsToRemove != null) | ||
370 | foreach(ThreadWatchdogInfo twi in threadsToRemove) | ||
371 | RemoveThread(twi.Thread.ManagedThreadId); | ||
368 | } | 372 | } |
369 | 373 | ||
370 | if(callbackInfos != null) | 374 | if(callbackInfos != null) |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 1ac5059..e431042 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -461,8 +461,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
461 | } | 461 | } |
462 | 462 | ||
463 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); | 463 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); |
464 | // resp.ReuseContext = true; | 464 | resp.ReuseContext = true; |
465 | resp.ReuseContext = false; | 465 | // resp.ReuseContext = false; |
466 | HandleRequest(req, resp); | 466 | HandleRequest(req, resp); |
467 | 467 | ||
468 | // !!!HACK ALERT!!! | 468 | // !!!HACK ALERT!!! |
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index b330384..7b806a4 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -842,7 +842,7 @@ namespace OpenSim.Framework.Servers | |||
842 | { | 842 | { |
843 | StreamReader RevisionFile = File.OpenText(svnRevisionFileName); | 843 | StreamReader RevisionFile = File.OpenText(svnRevisionFileName); |
844 | buildVersion = RevisionFile.ReadLine(); | 844 | buildVersion = RevisionFile.ReadLine(); |
845 | buildVersion.Trim(); | 845 | buildVersion = buildVersion.Trim(); |
846 | RevisionFile.Close(); | 846 | RevisionFile.Close(); |
847 | } | 847 | } |
848 | 848 | ||
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 96b91ff..01a06cd 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -705,8 +705,10 @@ namespace OpenSim.Framework | |||
705 | 705 | ||
706 | private static byte[] ComputeSHA1Hash(byte[] src) | 706 | private static byte[] ComputeSHA1Hash(byte[] src) |
707 | { | 707 | { |
708 | SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider(); | 708 | byte[] ret; |
709 | return SHA1.ComputeHash(src); | 709 | using(SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider()) |
710 | ret = SHA1.ComputeHash(src); | ||
711 | return ret; | ||
710 | } | 712 | } |
711 | 713 | ||
712 | public static int fast_distance2d(int x, int y) | 714 | public static int fast_distance2d(int x, int y) |