aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2013-05-01 21:39:49 +0100
committerMelanie2013-05-01 21:39:49 +0100
commit8c5445b774c602a13a7b49db1630b5f9fb9ff438 (patch)
tree6e829d2903b589c0c703793fb804632ea2324d62 /OpenSim
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-8c5445b774c602a13a7b49db1630b5f9fb9ff438.zip
opensim-SC_OLD-8c5445b774c602a13a7b49db1630b5f9fb9ff438.tar.gz
opensim-SC_OLD-8c5445b774c602a13a7b49db1630b5f9fb9ff438.tar.bz2
opensim-SC_OLD-8c5445b774c602a13a7b49db1630b5f9fb9ff438.tar.xz
Merge branch 'master' into careminster
Conflicts: ThirdParty/SmartThreadPool/SmartThreadPool.cs
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Capabilities/CapsHandlers.cs7
-rw-r--r--OpenSim/Framework/Util.cs20
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs13
-rw-r--r--OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs6
9 files changed, 41 insertions, 25 deletions
diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs
index 1709f46..458272d 100644
--- a/OpenSim/Capabilities/CapsHandlers.cs
+++ b/OpenSim/Capabilities/CapsHandlers.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Framework.Capabilities
158 /// capabilities and their handler details. 158 /// capabilities and their handler details.
159 /// </summary> 159 /// </summary>
160 /// <param name="excludeSeed">If true, then exclude the seed cap.</param> 160 /// <param name="excludeSeed">If true, then exclude the seed cap.</param>
161 public Hashtable GetCapsDetails(bool excludeSeed) 161 public Hashtable GetCapsDetails(bool excludeSeed, List<string> requestedCaps)
162 { 162 {
163 Hashtable caps = new Hashtable(); 163 Hashtable caps = new Hashtable();
164 string protocol = "http://"; 164 string protocol = "http://";
@@ -175,6 +175,9 @@ namespace OpenSim.Framework.Capabilities
175 if (excludeSeed && "SEED" == capsName) 175 if (excludeSeed && "SEED" == capsName)
176 continue; 176 continue;
177 177
178 if (requestedCaps != null && !requestedCaps.Contains(capsName))
179 continue;
180
178 caps[capsName] = baseUrl + m_capsHandlers[capsName].Path; 181 caps[capsName] = baseUrl + m_capsHandlers[capsName].Path;
179 } 182 }
180 } 183 }
@@ -182,4 +185,4 @@ namespace OpenSim.Framework.Capabilities
182 return caps; 185 return caps;
183 } 186 }
184 } 187 }
185} \ No newline at end of file 188}
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 557f38e..f520a01 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1852,7 +1852,7 @@ namespace OpenSim.Framework
1852 case FireAndForgetMethod.SmartThreadPool: 1852 case FireAndForgetMethod.SmartThreadPool:
1853 if (m_ThreadPool == null) 1853 if (m_ThreadPool == null)
1854 InitThreadPool(15); 1854 InitThreadPool(15);
1855 m_ThreadPool.QueueWorkItem(SmartThreadPoolCallback, new object[] { realCallback, obj }); 1855 m_ThreadPool.QueueWorkItem((cb, o) => cb(o), realCallback, obj);
1856 break; 1856 break;
1857 case FireAndForgetMethod.Thread: 1857 case FireAndForgetMethod.Thread:
1858 Thread thread = new Thread(delegate(object o) { realCallback(o); }); 1858 Thread thread = new Thread(delegate(object o) { realCallback(o); });
@@ -1922,15 +1922,15 @@ namespace OpenSim.Framework
1922 return sb.ToString(); 1922 return sb.ToString();
1923 } 1923 }
1924 1924
1925 private static object SmartThreadPoolCallback(object o) 1925// private static object SmartThreadPoolCallback(object o)
1926 { 1926// {
1927 object[] array = (object[])o; 1927// object[] array = (object[])o;
1928 WaitCallback callback = (WaitCallback)array[0]; 1928// WaitCallback callback = (WaitCallback)array[0];
1929 object obj = array[1]; 1929// object obj = array[1];
1930 1930//
1931 callback(obj); 1931// callback(obj);
1932 return null; 1932// return null;
1933 } 1933// }
1934 1934
1935 #endregion FireAndForget Threading Pattern 1935 #endregion FireAndForget Threading Pattern
1936 1936
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 921d3bf..59b9585 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -355,11 +355,22 @@ namespace OpenSim.Region.ClientStack.Linden
355 return string.Empty; 355 return string.Empty;
356 } 356 }
357 357
358 Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true); 358 OSDArray capsRequested = (OSDArray)OSDParser.DeserializeLLSDXml(request);
359 List<string> validCaps = new List<string>();
360
361 foreach (OSD c in capsRequested)
362 validCaps.Add(c.AsString());
363
364 Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true, validCaps);
359 365
360 // Add the external too 366 // Add the external too
361 foreach (KeyValuePair<string, string> kvp in m_HostCapsObj.ExternalCapsHandlers) 367 foreach (KeyValuePair<string, string> kvp in m_HostCapsObj.ExternalCapsHandlers)
368 {
369 if (!validCaps.Contains(kvp.Key))
370 continue;
371
362 caps[kvp.Key] = kvp.Value; 372 caps[kvp.Key] = kvp.Value;
373 }
363 374
364 string result = LLSDHelpers.SerialiseLLSDReply(caps); 375 string result = LLSDHelpers.SerialiseLLSDReply(caps);
365 376
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
index 2eb9bfb..fff86d5 100644
--- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Framework
252 { 252 {
253 caps.AppendFormat("** Circuit {0}:\n", kvp.Key); 253 caps.AppendFormat("** Circuit {0}:\n", kvp.Key);
254 254
255 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false).GetEnumerator(); kvp2.MoveNext(); ) 255 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); )
256 { 256 {
257 Uri uri = new Uri(kvp2.Value.ToString()); 257 Uri uri = new Uri(kvp2.Value.ToString());
258 caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); 258 caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index bbe7446..1d762c4 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -676,11 +676,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
676 } 676 }
677 else 677 else
678 { 678 {
679 if (remoteClient == null || so.OwnerID != remoteClient.AgentId) 679 if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId)
680 { 680 {
681 // Taking copy of another person's item. Take to 681 // Taking copy of another person's item. Take to
682 // Objects folder. 682 // Objects folder.
683 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); 683 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
684 so.FromFolderID = UUID.Zero;
684 } 685 }
685 else 686 else
686 { 687 {
@@ -696,7 +697,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
696 // 697 //
697 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) 698 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
698 { 699 {
699 if (so.FromFolderID != UUID.Zero && userID == remoteClient.AgentId) 700 if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
700 { 701 {
701 InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID); 702 InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID);
702 if (f != null) 703 if (f != null)
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index 35ae44c..b9a217b 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
51 public interface IScriptWorkItem 51 public interface IScriptWorkItem
52 { 52 {
53 bool Cancel(); 53 bool Cancel();
54 void Abort(); 54 bool Abort();
55 55
56 /// <summary> 56 /// <summary>
57 /// Wait for the work item to complete. 57 /// Wait for the work item to complete.
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index fa238aa..8da06d1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -572,9 +572,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
572 572
573 public bool Stop(int timeout) 573 public bool Stop(int timeout)
574 { 574 {
575// m_log.DebugFormat( 575 if (DebugLevel >= 1)
576// "[SCRIPT INSTANCE]: Stopping script {0} {1} in {2} {3} with timeout {4} {5} {6}", 576 m_log.DebugFormat(
577// ScriptName, ItemID, PrimName, ObjectID, timeout, m_InSelfDelete, DateTime.Now.Ticks); 577 "[SCRIPT INSTANCE]: Stopping script {0} {1} in {2} {3} with timeout {4} {5} {6}",
578 ScriptName, ItemID, PrimName, ObjectID, timeout, m_InSelfDelete, DateTime.Now.Ticks);
578 579
579 IScriptWorkItem workItem; 580 IScriptWorkItem workItem;
580 581
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index dd70f59..9d1e143 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -551,7 +551,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
551 /// <param name="instance"></param> 551 /// <param name="instance"></param>
552 /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param> 552 /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param>
553 private void HandleScriptsAction<TKey>( 553 private void HandleScriptsAction<TKey>(
554 string[] cmdparams, Action<IScriptInstance> action, Func<IScriptInstance, TKey> keySelector) 554 string[] cmdparams, Action<IScriptInstance> action, System.Func<IScriptInstance, TKey> keySelector)
555 { 555 {
556 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) 556 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
557 return; 557 return;
@@ -1599,7 +1599,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1599 startInfo.MaxWorkerThreads = maxThreads; 1599 startInfo.MaxWorkerThreads = maxThreads;
1600 startInfo.MinWorkerThreads = minThreads; 1600 startInfo.MinWorkerThreads = minThreads;
1601 startInfo.ThreadPriority = threadPriority;; 1601 startInfo.ThreadPriority = threadPriority;;
1602 startInfo.StackSize = stackSize; 1602 startInfo.MaxStackSize = stackSize;
1603 startInfo.StartSuspended = true; 1603 startInfo.StartSuspended = true;
1604 1604
1605 m_ThreadPool = new SmartThreadPool(startInfo); 1605 m_ThreadPool = new SmartThreadPool(startInfo);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
index 8dd7677..9d9dee1 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
@@ -52,16 +52,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
52 return wr.Cancel(); 52 return wr.Cancel();
53 } 53 }
54 54
55 public void Abort() 55 public bool Abort()
56 { 56 {
57 wr.Abort(); 57 return wr.Cancel(true);
58 } 58 }
59 59
60 public bool Wait(int t) 60 public bool Wait(int t)
61 { 61 {
62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the 62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the
63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an 63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an
64 // int (32-bit) we can end up with bad values. This occurs on Windows though curious not on Mono 2.10.8 64 // int (32-bit) we can end up with bad values. This occurs on Windows though curiously not on Mono 2.10.8
65 // (or very likely other versions of Mono at least up until 3.0.3). 65 // (or very likely other versions of Mono at least up until 3.0.3).
66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false); 66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false);
67 } 67 }