aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2015-03-04 16:35:27 +0000
committerJustin Clark-Casey (justincc)2015-03-04 16:35:27 +0000
commit1a185a048bbe60122fb713d305b85386e43ae6d3 (patch)
treeb7b6a20b0952bd792bcee9907b7228e816ce3cb6 /OpenSim/Framework
parentPrevent null entries being treated as URI's when DataSnapshot service splits ... (diff)
parentFix erratic Npc movement (diff)
downloadopensim-SC_OLD-1a185a048bbe60122fb713d305b85386e43ae6d3.zip
opensim-SC_OLD-1a185a048bbe60122fb713d305b85386e43ae6d3.tar.gz
opensim-SC_OLD-1a185a048bbe60122fb713d305b85386e43ae6d3.tar.bz2
opensim-SC_OLD-1a185a048bbe60122fb713d305b85386e43ae6d3.tar.xz
Merge commit '7e8bad05ec6150e082fb634e3210b83c33dbcfe7' into 0.8.1-post-fixes
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/JobEngine.cs18
-rw-r--r--OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs29
-rw-r--r--OpenSim/Framework/ServiceAuth/IServiceAuth.cs29
-rw-r--r--OpenSim/Framework/ServiceAuth/ServiceAuth.cs29
-rw-r--r--OpenSim/Framework/Util.cs16
5 files changed, 115 insertions, 6 deletions
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs
index 44f5d9a..6db9a67 100644
--- a/OpenSim/Framework/Monitoring/JobEngine.cs
+++ b/OpenSim/Framework/Monitoring/JobEngine.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Monitoring
78 78
79 private BlockingCollection<Job> m_jobQueue; 79 private BlockingCollection<Job> m_jobQueue;
80 80
81 private CancellationTokenSource m_cancelSource = new CancellationTokenSource(); 81 private CancellationTokenSource m_cancelSource;
82 82
83 /// <summary> 83 /// <summary>
84 /// Used to signal that we are ready to complete stop. 84 /// Used to signal that we are ready to complete stop.
@@ -105,6 +105,7 @@ namespace OpenSim.Framework.Monitoring
105 m_finishedProcessingAfterStop.Reset(); 105 m_finishedProcessingAfterStop.Reset();
106 106
107 m_jobQueue = new BlockingCollection<Job>(new ConcurrentQueue<Job>(), 5000); 107 m_jobQueue = new BlockingCollection<Job>(new ConcurrentQueue<Job>(), 5000);
108 m_cancelSource = new CancellationTokenSource();
108 109
109 WorkManager.StartThread( 110 WorkManager.StartThread(
110 ProcessRequests, 111 ProcessRequests,
@@ -160,7 +161,6 @@ namespace OpenSim.Framework.Monitoring
160 finally 161 finally
161 { 162 {
162 m_cancelSource.Dispose(); 163 m_cancelSource.Dispose();
163 m_jobQueue = null;
164 } 164 }
165 } 165 }
166 } 166 }
@@ -249,7 +249,19 @@ namespace OpenSim.Framework.Monitoring
249 { 249 {
250 while (IsRunning || m_jobQueue.Count > 0) 250 while (IsRunning || m_jobQueue.Count > 0)
251 { 251 {
252 CurrentJob = m_jobQueue.Take(m_cancelSource.Token); 252 try
253 {
254 CurrentJob = m_jobQueue.Take(m_cancelSource.Token);
255 }
256 catch (ObjectDisposedException e)
257 {
258 // If we see this whilst not running then it may be due to a race where this thread checks
259 // IsRunning after the stopping thread sets it to false and disposes of the cancellation source.
260 if (IsRunning)
261 throw e;
262 else
263 break;
264 }
253 265
254 if (LogLevel >= 1) 266 if (LogLevel >= 1)
255 m_log.DebugFormat("[{0}]: Processing job {1}", LoggingName, CurrentJob.Name); 267 m_log.DebugFormat("[{0}]: Processing job {1}", LoggingName, CurrentJob.Name);
diff --git a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs
index d182a71..b3d64e1 100644
--- a/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs
+++ b/OpenSim/Framework/ServiceAuth/BasicHttpAuthentication.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Collections.Specialized; 30using System.Collections.Specialized;
4using System.Reflection; 31using System.Reflection;
diff --git a/OpenSim/Framework/ServiceAuth/IServiceAuth.cs b/OpenSim/Framework/ServiceAuth/IServiceAuth.cs
index 415dc12..fdd97b2 100644
--- a/OpenSim/Framework/ServiceAuth/IServiceAuth.cs
+++ b/OpenSim/Framework/ServiceAuth/IServiceAuth.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Collections.Specialized; 30using System.Collections.Specialized;
4 31
diff --git a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs
index bc32d90..5ab613b 100644
--- a/OpenSim/Framework/ServiceAuth/ServiceAuth.cs
+++ b/OpenSim/Framework/ServiceAuth/ServiceAuth.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3 30
4using Nini.Config; 31using Nini.Config;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 836fa5f..56a90b1 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -420,6 +420,22 @@ namespace OpenSim.Framework
420 return x; 420 return x;
421 } 421 }
422 422
423 /// <summary>
424 /// Check if any of the values in a Vector3 are NaN or Infinity
425 /// </summary>
426 /// <param name="v">Vector3 to check</param>
427 /// <returns></returns>
428 public static bool IsNanOrInfinity(Vector3 v)
429 {
430 if (float.IsNaN(v.X) || float.IsNaN(v.Y) || float.IsNaN(v.Z))
431 return true;
432
433 if (float.IsInfinity(v.X) || float.IsInfinity(v.Y) || float.IsNaN(v.Z))
434 return true;
435
436 return false;
437 }
438
423 // Inclusive, within range test (true if equal to the endpoints) 439 // Inclusive, within range test (true if equal to the endpoints)
424 public static bool InRange<T>(T x, T min, T max) 440 public static bool InRange<T>(T x, T min, T max)
425 where T : IComparable<T> 441 where T : IComparable<T>