From 180d199218eb95ab0c4e8be56a3edaef97379a1e Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 2 Sep 2009 20:00:36 -0700 Subject: [PATCH 01/11] git test commit --- TESTING.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/TESTING.txt b/TESTING.txt index 94f58874e9..e0a7748e6f 100644 --- a/TESTING.txt +++ b/TESTING.txt @@ -135,3 +135,4 @@ nunit-console2 OpenSim.Framework.Tests.dll (on linux) nunit-console OpenSim.Framework.Tests.dll (on windows) For more information on testing contact the autor of this testing readme: Daedius Moskvitch ( daedius @@@@ daedius com) + From 9696481a647e395a05b1eee0e9c5b03df320aaf9 Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 2 Sep 2009 20:08:53 -0700 Subject: [PATCH 02/11] another git test --- README.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.txt b/README.txt index cdbf011b04..83ac7d6265 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Welcome to OpenSim! Version 0.6.x - + == OVERVIEW == OpenSim is a BSD Licensed Open Source project to develop a functioning @@ -90,4 +90,3 @@ project can always be found at http://opensimulator.org. Thanks for trying OpenSim, we hope it is a pleasant experience. - From 01242c5ccb5abe2cf0b1ad7ad619d606827bd4bb Mon Sep 17 00:00:00 2001 From: "dr scofield (aka dirk husemann)" Date: Thu, 3 Sep 2009 18:31:02 +0200 Subject: [PATCH 03/11] making Makefile a bit more robust: can now cope with missing ruby in a better way. --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 46ddc2f19e..493cdca619 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,14 @@ -NANT = $(shell if test "$$EMACS" = "t" ; then echo "nant"; else echo "./nant-color"; fi) +# hey, emacs! this is a -*- makefile -*- +# +# OpenSim makefile +# + +RUBY = $(strip $(shell which ruby 2>/dev/null)) +ifeq ($(RUBY),) +NANT = nant +else +NANT = $(shell if test "$$EMACS" = "t" ; then echo "nant"; else echo "./nant-color"; fi) +endif all: prebuild # @export PATH=/usr/local/bin:$(PATH) @@ -14,7 +24,7 @@ prebuild: clean: # @export PATH=/usr/local/bin:$(PATH) - ${NANT} clean + -${NANT} clean test: prebuild ${NANT} test From c4ae9413f1658d6b8cb42b6e382592c91e060f7b Mon Sep 17 00:00:00 2001 From: Chris Hart Date: Wed, 2 Sep 2009 21:42:41 +0100 Subject: [PATCH 04/11] MSSQL Minor tweak to recent patch for region loading (Thanks Grumly57 for spotting it!) --- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index c9e4bfe0c0..adedcce81d 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -210,6 +210,7 @@ namespace OpenSim.Data.MSSQL { foreach (SceneObjectPart objectPart in allPrimsWithInventory) { + command.Parameters.Clear(); command.Parameters.Add(_Database.CreateParameter("@PrimID", objectPart.UUID)); List inventory = new List(); From 64fa23df7c1ab196ec1b901839e71837403b29ce Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 3 Sep 2009 19:41:38 +0100 Subject: [PATCH 05/11] If a test dll fails, stop immediately rather than trying all the other test dlls This is very useful behaviour if debugging test failures otherwise it's hard to pick out the test output Also, some minor method shuffling in the iar module --- .nant/local.include | 35 +++++++------ .../Archiver/InventoryArchiveWriteRequest.cs | 5 +- .../Archiver/InventoryArchiverModule.cs | 51 ++++++++++--------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/.nant/local.include b/.nant/local.include index 510bdc66dc..6ad893aacb 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -37,48 +37,47 @@ + - + + - + + - + + - + + - + + - + + - + + - + - - - - - - - - - - + diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 4ee90e2aa3..f73a7e3844 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -199,6 +199,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver InventoryFolderImpl inventoryFolder = null; InventoryItemBase inventoryItem = null; + /* if (!m_userInfo.HasReceivedInventory) { // If the region server has access to the user admin service (by which users are created), @@ -220,13 +221,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_userInfo.FetchInventory(); } } + */ bool foundStar = false; // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl // itself (possibly at a small loss in efficiency). string[] components - = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); + = m_invPath.Split( + new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); int maxComponentIndex = components.Length - 1; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index d3ba5fe11f..c495e022ab 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// private Dictionary m_scenes = new Dictionary(); private Scene m_aScene; + /// /// The comms manager we will use for all comms requests /// @@ -110,8 +111,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; if (handlerInventoryArchiveSaved != null) handlerInventoryArchiveSaved(succeeded, userInfo, invPath, saveStream, reportedException); + } + + public void ArchiveInventory(string firstName, string lastName, string invPath, Stream saveStream) + { + if (m_scenes.Count > 0) + { + CachedUserInfo userInfo = GetUserInfo(firstName, lastName); + + if (userInfo != null) + new InventoryArchiveWriteRequest(this, userInfo, invPath, saveStream).Execute(); + } } - + + public void ArchiveInventory(string firstName, string lastName, string invPath, string savePath) + { + if (m_scenes.Count > 0) + { + CachedUserInfo userInfo = GetUserInfo(firstName, lastName); + + if (userInfo != null) + new InventoryArchiveWriteRequest(this, userInfo, invPath, savePath).Execute(); + } + } + public void DearchiveInventory(string firstName, string lastName, string invPath, Stream loadStream) { if (m_scenes.Count > 0) @@ -125,18 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); } } - } - - public void ArchiveInventory(string firstName, string lastName, string invPath, Stream saveStream) - { - if (m_scenes.Count > 0) - { - CachedUserInfo userInfo = GetUserInfo(firstName, lastName); - - if (userInfo != null) - new InventoryArchiveWriteRequest(this, userInfo, invPath, saveStream).Execute(); - } - } + } public void DearchiveInventory(string firstName, string lastName, string invPath, string loadPath) { @@ -151,18 +163,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); } } - } - - public void ArchiveInventory(string firstName, string lastName, string invPath, string savePath) - { - if (m_scenes.Count > 0) - { - CachedUserInfo userInfo = GetUserInfo(firstName, lastName); - - if (userInfo != null) - new InventoryArchiveWriteRequest(this, userInfo, invPath, savePath).Execute(); - } - } + } /// /// Load inventory from an inventory file archive From 9bd0106333771f084ce2774dac8e264d0d91f772 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 3 Sep 2009 14:55:54 -0400 Subject: [PATCH 06/11] some more tooling around on nant / nunit to make it a bit cleaner --- .nant/local.include | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.nant/local.include b/.nant/local.include index 6ad893aacb..58d1ad1160 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -34,50 +34,55 @@ + - - - - - - - - + + + + + + + + + From bc6b4c5bf6a00444bd9553d515983e1fe0b397d5 Mon Sep 17 00:00:00 2001 From: Dave Coyle Date: Wed, 19 Aug 2009 15:19:18 -0400 Subject: [PATCH 07/11] document options in OpenSim.ConsoleClient.ini.example --- bin/OpenSim.ConsoleClient.ini.example | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/OpenSim.ConsoleClient.ini.example b/bin/OpenSim.ConsoleClient.ini.example index beea7d875b..628ff86eea 100644 --- a/bin/OpenSim.ConsoleClient.ini.example +++ b/bin/OpenSim.ConsoleClient.ini.example @@ -1 +1,12 @@ [Startup] + ; set here or use the -user command-line switch + ;user = Test + + ; set here or use the -host command-line switch + ;host = localhost + + ; set here or use the -port command-line switch + ;port = 8003 + + ; set here or use the -pass command-line switch + ;pass = secret From 6b70b5709913e9734f5864560e997b34dfd58b85 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 3 Sep 2009 20:00:18 +0100 Subject: [PATCH 08/11] * Add extra warning about using -pass in OpenSim.ConsoleClient.ini.example --- bin/OpenSim.ConsoleClient.ini.example | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/OpenSim.ConsoleClient.ini.example b/bin/OpenSim.ConsoleClient.ini.example index 628ff86eea..5223d1d262 100644 --- a/bin/OpenSim.ConsoleClient.ini.example +++ b/bin/OpenSim.ConsoleClient.ini.example @@ -1,12 +1,14 @@ [Startup] - ; set here or use the -user command-line switch + ; Set here or use the -user command-line switch ;user = Test - ; set here or use the -host command-line switch + ; Set here or use the -host command-line switch ;host = localhost - ; set here or use the -port command-line switch + ; Set here or use the -port command-line switch ;port = 8003 - ; set here or use the -pass command-line switch + ; Set here or use the -pass command-line switch + ; Please be aware that this is not secure since the password is in the clear + ; we recommend the use of -pass wherever possible ;pass = secret From a3183b20253e90e63152e99370c2e6e4ce61abb8 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 3 Sep 2009 15:00:53 -0400 Subject: [PATCH 09/11] in case ruby is somewhere else in the path (just used for coloring output) --- nant-color | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nant-color b/nant-color index c4cebb043d..b36898681b 100755 --- a/nant-color +++ b/nant-color @@ -1,5 +1,4 @@ -#!/usr/bin/ruby - +#!/usr/bin/env ruby def main IO.popen("nant #{ARGV.join(' ')}") { |pipe| From 584c1138361c6c5ed3ad18225760fb5f9e88093a Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 1 Sep 2009 11:26:08 -0700 Subject: [PATCH 10/11] Added Util.FireAndForget(), to replace leaking calls to Delegate.BeginInvoke() --- OpenSim/Framework/Util.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index bbb0ae2286..58344f30c8 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1169,5 +1169,27 @@ namespace OpenSim.Framework return found.ToArray(); } + + #region FireAndForget Threading Pattern + + public static void FireAndForget(System.Threading.WaitCallback callback) + { + callback.BeginInvoke(null, EndFireAndForget, callback); + } + + public static void FireAndForget(System.Threading.WaitCallback callback, object obj) + { + callback.BeginInvoke(obj, EndFireAndForget, callback); + } + + private static void EndFireAndForget(IAsyncResult ar) + { + System.Threading.WaitCallback callback = (System.Threading.WaitCallback)ar.AsyncState; + + callback.EndInvoke(ar); + ar.AsyncWaitHandle.Close(); + } + + #endregion FireAndForget Threading Pattern } } From 33133e23b12781e71b499fcaa41bcad6374c6656 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 1 Sep 2009 12:07:48 -0700 Subject: [PATCH 11/11] Fixes seven leaky .BeginInvoke() calls --- .../CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 2 +- .../Asset/LocalAssetServiceConnector.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 4 ++++ OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 2 +- .../Connectors/Inventory/InventoryServiceConnector.cs | 2 ++ OpenSim/Services/InventoryService/InventoryService.cs | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 621e9d2855..7b4e374819 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (asset != null) { - handler.BeginInvoke(id, sender, asset, null, null); + Util.FireAndForget(delegate { handler(id, sender, asset); }); return true; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index b13a116418..fd3aaf4fd1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs @@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (asset != null) { - handler.BeginInvoke(id, sender, asset, null, null); + Util.FireAndForget(delegate { handler(id, sender, asset); }); return true; } @@ -219,8 +219,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset { if ((a != null) && (m_Cache != null)) m_Cache.Cache(a); - - handler.BeginInvoke(assetID, s, a, null, null); + + Util.FireAndForget(delegate { handler(assetID, s, a); }); }); } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 55b100b0db..fddba86cbe 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -457,6 +457,8 @@ namespace OpenSim.Region.Framework.Scenes void SendInventoryComplete(IAsyncResult iar) { + SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState; + d.EndInvoke(iar); } /// @@ -622,6 +624,8 @@ namespace OpenSim.Region.Framework.Scenes private void PurgeFolderCompleted(IAsyncResult iar) { + PurgeFolderDelegate d = (PurgeFolderDelegate)iar.AsyncState; + d.EndInvoke(iar); } } } diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index d9748d4fd8..ffc8e4ce53 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -177,7 +177,7 @@ namespace OpenSim.Services.Connectors } else { - handler.BeginInvoke(id, sender, asset, null, null); + Util.FireAndForget(delegate { handler(id, sender, asset); }); } return true; diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index a2261ba0f4..cef678ddd0 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs @@ -461,6 +461,8 @@ namespace OpenSim.Services.Connectors private void MoveItemsCompleted(IAsyncResult iar) { + MoveItemsDelegate d = (MoveItemsDelegate)iar.AsyncState; + d.EndInvoke(iar); } public bool MoveItems(string userID, List items, UUID sessionID) diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index f04754b195..b98e256c06 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs @@ -232,7 +232,7 @@ namespace OpenSim.Services.InventoryService m_log.WarnFormat("[INVENTORY SERVICE]: User {0} inventory not available", userID); } - callback.BeginInvoke(folders, items, null, null); + Util.FireAndForget(delegate { callback(folders, items); }); } public InventoryCollection GetFolderContent(UUID userID, UUID folderID)