diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index a4898061da..9941a7f147 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs @@ -46,7 +46,7 @@ namespace OpenSim.Framework case AssetType.Texture: return "image/x-j2c"; case AssetType.Sound: - return "application/ogg"; + return "audio/ogg"; case AssetType.CallingCard: return "application/vnd.ll.callingcard"; case AssetType.Landmark: @@ -98,8 +98,6 @@ namespace OpenSim.Framework return "application/vnd.ll.outfitfolder"; case AssetType.MyOutfitsFolder: return "application/vnd.ll.myoutfitsfolder"; - case AssetType.InboxFolder: - return "application/vnd.ll.inboxfolder"; case AssetType.Unknown: default: return "application/octet-stream"; @@ -128,7 +126,7 @@ namespace OpenSim.Framework case InventoryType.Object: return "application/vnd.ll.primitive"; case InventoryType.Sound: - return "application/ogg"; + return "audio/ogg"; case InventoryType.Snapshot: case InventoryType.Texture: return "image/x-j2c"; @@ -147,6 +145,7 @@ namespace OpenSim.Framework case "image/jp2": return (sbyte)AssetType.Texture; case "application/ogg": + case "audio/ogg": return (sbyte)AssetType.Sound; case "application/vnd.ll.callingcard": case "application/x-metaverse-callingcard": @@ -209,8 +208,6 @@ namespace OpenSim.Framework return (sbyte)AssetType.OutfitFolder; case "application/vnd.ll.myoutfitsfolder": return (sbyte)AssetType.MyOutfitsFolder; - case "application/vnd.ll.inboxfolder": - return (sbyte)AssetType.InboxFolder; case "application/octet-stream": default: return (sbyte)AssetType.Unknown; @@ -227,6 +224,7 @@ namespace OpenSim.Framework case "image/jpeg": return (sbyte)InventoryType.Texture; case "application/ogg": + case "audio/ogg": case "audio/x-wav": return (sbyte)InventoryType.Sound; case "application/vnd.ll.callingcard": diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9cdc80b707..0925222fb7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3529,9 +3529,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void ProcessEntityUpdates(int maxUpdates) { - Lazy> objectUpdateBlocks = new Lazy>(); - Lazy> compressedUpdateBlocks = new Lazy>(); - Lazy> terseUpdateBlocks = new Lazy>(); + OpenMetaverse.Lazy> objectUpdateBlocks = new OpenMetaverse.Lazy>(); + OpenMetaverse.Lazy> compressedUpdateBlocks = new OpenMetaverse.Lazy>(); + OpenMetaverse.Lazy> terseUpdateBlocks = new OpenMetaverse.Lazy>(); if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index e43f7cf57a..194c064be9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -140,13 +140,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Process all the pending adds OutgoingPacket pendingAdd; - while (m_pendingAdds.Dequeue(out pendingAdd)) + while (m_pendingAdds.TryDequeue(out pendingAdd)) m_packets[pendingAdd.SequenceNumber] = pendingAdd; // Process all the pending removes, including updating statistics and round-trip times PendingAck pendingRemove; OutgoingPacket ackedPacket; - while (m_pendingRemoves.Dequeue(out pendingRemove)) + while (m_pendingRemoves.TryDequeue(out pendingRemove)) { if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) { diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9eaa758bd5..5255d30d3d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache } else { - m_MemoryCache.AddOrUpdate(key, asset, DateTime.MaxValue); + m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue); } } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index e1bc243c9e..e7cfda1bf1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs @@ -36,6 +36,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts { public class UserAccountCache { + private const double CACHE_EXPIRATION_SECONDS = 120.0; + private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); @@ -51,9 +53,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts public void Cache(UUID userID, UserAccount account) { // Cache even null accounts - m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); if (account != null) - m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 58698ee189..0f0840868c 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -48,6 +48,7 @@ using OpenSim.Tests.Common.Setup; using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants; using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader; using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter; +using RegionSettings = OpenSim.Framework.RegionSettings; namespace OpenSim.Region.CoreModules.World.Archiver.Tests { @@ -135,7 +136,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part2 = CreateSceneObjectPart2(); - AssetNotecard nc = new AssetNotecard("Hello World!"); + AssetNotecard nc = new AssetNotecard(); + nc.BodyText = "Hello World!"; + nc.Encode(); UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); AssetBase ncAsset diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index da8199ddf4..5e491c2403 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -75,7 +75,9 @@ namespace OpenSim.Region.Framework.Tests protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part) { - AssetNotecard nc = new AssetNotecard("Hello World!"); + AssetNotecard nc = new AssetNotecard(); + nc.BodyText = "Hello World!"; + nc.Encode(); UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); AssetBase ncAsset diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 446ac717f1..23f2b10d53 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -49,6 +49,8 @@ namespace OpenSim.Services.Connectors.SimianGrid [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule { + private const double CACHE_EXPIRATION_SECONDS = 120.0; + private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); @@ -141,7 +143,15 @@ namespace OpenSim.Services.Connectors.SimianGrid { "UserID", userID.ToString() } }; - return GetUser(requestArgs); + account = GetUser(requestArgs); + + if (account == null) + { + // Store null responses too, to avoid repeated lookups for missing accounts + m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS); + } + + return account; } public List GetUserAccounts(UUID scopeID, string query) @@ -216,7 +226,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (success) { // Cache the user account info - m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS); } else { @@ -281,7 +291,7 @@ namespace OpenSim.Services.Connectors.SimianGrid GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); // Cache the user account info - m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS); return account; } diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index 54681e4bfe..7909076907 100644 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 59e39bbf60..12a2940f68 100644 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 01dc3d813c..1329aa79cc 100644 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ