aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohn Hurliman2010-09-07 14:41:13 -0700
committerJohn Hurliman2010-09-07 14:41:13 -0700
commit9be1c0ff448d4ea650ca921937905653b4017d61 (patch)
tree845b09cb064fb023993b559671ec22d4678d8c1b
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-9be1c0ff448d4ea650ca921937905653b4017d61.zip
opensim-SC-9be1c0ff448d4ea650ca921937905653b4017d61.tar.gz
opensim-SC-9be1c0ff448d4ea650ca921937905653b4017d61.tar.bz2
opensim-SC-9be1c0ff448d4ea650ca921937905653b4017d61.tar.xz
* Cache null account responses in the SimianUserAccountServiceConnector to avoid repeated requests for missing avatar IDs
* Updated to OpenMetaverse r3442 to fix a timezone issue with ExpiringCache
-rw-r--r--OpenSim/Framework/SLUtil.cs10
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs4
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs4
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs16
-rw-r--r--bin/OpenMetaverse.StructuredData.dllbin102400 -> 102400 bytes
-rw-r--r--bin/OpenMetaverse.dllbin1691648 -> 1716224 bytes
-rw-r--r--bin/OpenMetaverseTypes.dllbin106496 -> 114688 bytes
11 files changed, 34 insertions, 19 deletions
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs
index a489806..9941a7f 100644
--- a/OpenSim/Framework/SLUtil.cs
+++ b/OpenSim/Framework/SLUtil.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Framework
46 case AssetType.Texture: 46 case AssetType.Texture:
47 return "image/x-j2c"; 47 return "image/x-j2c";
48 case AssetType.Sound: 48 case AssetType.Sound:
49 return "application/ogg"; 49 return "audio/ogg";
50 case AssetType.CallingCard: 50 case AssetType.CallingCard:
51 return "application/vnd.ll.callingcard"; 51 return "application/vnd.ll.callingcard";
52 case AssetType.Landmark: 52 case AssetType.Landmark:
@@ -98,8 +98,6 @@ namespace OpenSim.Framework
98 return "application/vnd.ll.outfitfolder"; 98 return "application/vnd.ll.outfitfolder";
99 case AssetType.MyOutfitsFolder: 99 case AssetType.MyOutfitsFolder:
100 return "application/vnd.ll.myoutfitsfolder"; 100 return "application/vnd.ll.myoutfitsfolder";
101 case AssetType.InboxFolder:
102 return "application/vnd.ll.inboxfolder";
103 case AssetType.Unknown: 101 case AssetType.Unknown:
104 default: 102 default:
105 return "application/octet-stream"; 103 return "application/octet-stream";
@@ -128,7 +126,7 @@ namespace OpenSim.Framework
128 case InventoryType.Object: 126 case InventoryType.Object:
129 return "application/vnd.ll.primitive"; 127 return "application/vnd.ll.primitive";
130 case InventoryType.Sound: 128 case InventoryType.Sound:
131 return "application/ogg"; 129 return "audio/ogg";
132 case InventoryType.Snapshot: 130 case InventoryType.Snapshot:
133 case InventoryType.Texture: 131 case InventoryType.Texture:
134 return "image/x-j2c"; 132 return "image/x-j2c";
@@ -147,6 +145,7 @@ namespace OpenSim.Framework
147 case "image/jp2": 145 case "image/jp2":
148 return (sbyte)AssetType.Texture; 146 return (sbyte)AssetType.Texture;
149 case "application/ogg": 147 case "application/ogg":
148 case "audio/ogg":
150 return (sbyte)AssetType.Sound; 149 return (sbyte)AssetType.Sound;
151 case "application/vnd.ll.callingcard": 150 case "application/vnd.ll.callingcard":
152 case "application/x-metaverse-callingcard": 151 case "application/x-metaverse-callingcard":
@@ -209,8 +208,6 @@ namespace OpenSim.Framework
209 return (sbyte)AssetType.OutfitFolder; 208 return (sbyte)AssetType.OutfitFolder;
210 case "application/vnd.ll.myoutfitsfolder": 209 case "application/vnd.ll.myoutfitsfolder":
211 return (sbyte)AssetType.MyOutfitsFolder; 210 return (sbyte)AssetType.MyOutfitsFolder;
212 case "application/vnd.ll.inboxfolder":
213 return (sbyte)AssetType.InboxFolder;
214 case "application/octet-stream": 211 case "application/octet-stream":
215 default: 212 default:
216 return (sbyte)AssetType.Unknown; 213 return (sbyte)AssetType.Unknown;
@@ -227,6 +224,7 @@ namespace OpenSim.Framework
227 case "image/jpeg": 224 case "image/jpeg":
228 return (sbyte)InventoryType.Texture; 225 return (sbyte)InventoryType.Texture;
229 case "application/ogg": 226 case "application/ogg":
227 case "audio/ogg":
230 case "audio/x-wav": 228 case "audio/x-wav":
231 return (sbyte)InventoryType.Sound; 229 return (sbyte)InventoryType.Sound;
232 case "application/vnd.ll.callingcard": 230 case "application/vnd.ll.callingcard":
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9cdc80b..0925222 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3529,9 +3529,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3529 3529
3530 private void ProcessEntityUpdates(int maxUpdates) 3530 private void ProcessEntityUpdates(int maxUpdates)
3531 { 3531 {
3532 Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); 3532 OpenMetaverse.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenMetaverse.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
3533 Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>(); 3533 OpenMetaverse.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenMetaverse.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
3534 Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); 3534 OpenMetaverse.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenMetaverse.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
3535 3535
3536 if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; 3536 if (maxUpdates <= 0) maxUpdates = Int32.MaxValue;
3537 int updatesThisCall = 0; 3537 int updatesThisCall = 0;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index e43f7cf..194c064 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -140,13 +140,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
140 { 140 {
141 // Process all the pending adds 141 // Process all the pending adds
142 OutgoingPacket pendingAdd; 142 OutgoingPacket pendingAdd;
143 while (m_pendingAdds.Dequeue(out pendingAdd)) 143 while (m_pendingAdds.TryDequeue(out pendingAdd))
144 m_packets[pendingAdd.SequenceNumber] = pendingAdd; 144 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
145 145
146 // Process all the pending removes, including updating statistics and round-trip times 146 // Process all the pending removes, including updating statistics and round-trip times
147 PendingAck pendingRemove; 147 PendingAck pendingRemove;
148 OutgoingPacket ackedPacket; 148 OutgoingPacket ackedPacket;
149 while (m_pendingRemoves.Dequeue(out pendingRemove)) 149 while (m_pendingRemoves.TryDequeue(out pendingRemove))
150 { 150 {
151 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) 151 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
152 { 152 {
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 9eaa758..5255d30 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache
252 } 252 }
253 else 253 else
254 { 254 {
255 m_MemoryCache.AddOrUpdate(key, asset, DateTime.MaxValue); 255 m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue);
256 } 256 }
257 } 257 }
258 } 258 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
index e1bc243..e7cfda1 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
36{ 36{
37 public class UserAccountCache 37 public class UserAccountCache
38 { 38 {
39 private const double CACHE_EXPIRATION_SECONDS = 120.0;
40
39 private static readonly ILog m_log = 41 private static readonly ILog m_log =
40 LogManager.GetLogger( 42 LogManager.GetLogger(
41 MethodBase.GetCurrentMethod().DeclaringType); 43 MethodBase.GetCurrentMethod().DeclaringType);
@@ -51,9 +53,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
51 public void Cache(UUID userID, UserAccount account) 53 public void Cache(UUID userID, UserAccount account)
52 { 54 {
53 // Cache even null accounts 55 // Cache even null accounts
54 m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); 56 m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
55 if (account != null) 57 if (account != null)
56 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d)); 58 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS);
57 59
58 m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); 60 m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
59 } 61 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 58698ee..0f08408 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;
48using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants; 48using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants;
49using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader; 49using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader;
50using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter; 50using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter;
51using RegionSettings = OpenSim.Framework.RegionSettings;
51 52
52namespace OpenSim.Region.CoreModules.World.Archiver.Tests 53namespace OpenSim.Region.CoreModules.World.Archiver.Tests
53{ 54{
@@ -135,7 +136,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
135 136
136 SceneObjectPart part2 = CreateSceneObjectPart2(); 137 SceneObjectPart part2 = CreateSceneObjectPart2();
137 138
138 AssetNotecard nc = new AssetNotecard("Hello World!"); 139 AssetNotecard nc = new AssetNotecard();
140 nc.BodyText = "Hello World!";
141 nc.Encode();
139 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); 142 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
140 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); 143 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
141 AssetBase ncAsset 144 AssetBase ncAsset
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index da8199d..5e491c2 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
75 75
76 protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part) 76 protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
77 { 77 {
78 AssetNotecard nc = new AssetNotecard("Hello World!"); 78 AssetNotecard nc = new AssetNotecard();
79 nc.BodyText = "Hello World!";
80 nc.Encode();
79 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); 81 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
80 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); 82 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
81 AssetBase ncAsset 83 AssetBase ncAsset
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 446ac71..23f2b10 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -49,6 +49,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
50 public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule 50 public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule
51 { 51 {
52 private const double CACHE_EXPIRATION_SECONDS = 120.0;
53
52 private static readonly ILog m_log = 54 private static readonly ILog m_log =
53 LogManager.GetLogger( 55 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType); 56 MethodBase.GetCurrentMethod().DeclaringType);
@@ -141,7 +143,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
141 { "UserID", userID.ToString() } 143 { "UserID", userID.ToString() }
142 }; 144 };
143 145
144 return GetUser(requestArgs); 146 account = GetUser(requestArgs);
147
148 if (account == null)
149 {
150 // Store null responses too, to avoid repeated lookups for missing accounts
151 m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS);
152 }
153
154 return account;
145 } 155 }
146 156
147 public List<UserAccount> GetUserAccounts(UUID scopeID, string query) 157 public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
@@ -216,7 +226,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
216 if (success) 226 if (success)
217 { 227 {
218 // Cache the user account info 228 // Cache the user account info
219 m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromMinutes(2.0d)); 229 m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS);
220 } 230 }
221 else 231 else
222 { 232 {
@@ -281,7 +291,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
281 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); 291 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
282 292
283 // Cache the user account info 293 // Cache the user account info
284 m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); 294 m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS);
285 295
286 return account; 296 return account;
287 } 297 }
diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll
index 54681e4..7909076 100644
--- a/bin/OpenMetaverse.StructuredData.dll
+++ b/bin/OpenMetaverse.StructuredData.dll
Binary files differ
diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll
index 59e39bb..12a2940 100644
--- a/bin/OpenMetaverse.dll
+++ b/bin/OpenMetaverse.dll
Binary files differ
diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll
index 01dc3d8..1329aa7 100644
--- a/bin/OpenMetaverseTypes.dll
+++ b/bin/OpenMetaverseTypes.dll
Binary files differ