From 99c85b5ef541b83dc09e93c66232c3893e348e4b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Oct 2009 20:32:33 +0100 Subject: * Change some more default ports to the robust default of 8003 * Make these use existing constants rather than hardcoding * These will probably go away soon anyway once all services are under ROBUST --- OpenSim/Framework/ConfigSettings.cs | 4 ++-- OpenSim/Framework/InventoryConfig.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs index 93efffa..32415e0 100644 --- a/OpenSim/Framework/ConfigSettings.cs +++ b/OpenSim/Framework/ConfigSettings.cs @@ -168,7 +168,7 @@ namespace OpenSim.Framework public const bool DefaultUserServerHttpSSL = false; public const uint DefaultMessageServerHttpPort = 8006; public const bool DefaultMessageServerHttpSSL = false; - public const uint DefaultGridServerHttpPort = 8001; - public const uint DefaultInventoryServerHttpPort = 8004; + public const uint DefaultGridServerHttpPort = 8003; + public const uint DefaultInventoryServerHttpPort = 8003; } } diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index f539d55..dd207ad 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs @@ -56,15 +56,15 @@ namespace OpenSim.Framework m_configMember.addConfigurationOption("default_inventory_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Inventory Server URI (this server's external name)", - "http://127.0.0.1:8004", false); + "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort, false); m_configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", - "http://127.0.0.1:8002", false); + "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort, false); m_configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", - "http://127.0.0.1:8003", false); + "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort, false); m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, -- cgit v1.1 From e992ca025571a891333a57012c2cd4419b6581e5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 6 Oct 2009 15:39:53 -0700 Subject: Rewrote parts of the code that were double-locking different objects. This is about half of the code base reviewed. --- .../Cache/UserProfileCacheService.cs | 66 +++++++++------------- 1 file changed, 27 insertions(+), 39 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 9e12d948..b02cf5b 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -128,24 +128,18 @@ namespace OpenSim.Framework.Communications.Cache /// null if no user details are found public CachedUserInfo GetUserDetails(string fname, string lname) { + CachedUserInfo userInfo; lock (m_userProfilesByName) - { - CachedUserInfo userInfo; - + { if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) - { return userInfo; - } - else - { - UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); - - if (userProfile != null) - return AddToCaches(userProfile); - else - return null; - } } + UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); + + if (userProfile != null) + return AddToCaches(userProfile); + else + return null; } /// @@ -160,20 +154,14 @@ namespace OpenSim.Framework.Communications.Cache return null; lock (m_userProfilesById) - { if (m_userProfilesById.ContainsKey(userID)) - { return m_userProfilesById[userID]; - } - else - { - UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); - if (userProfile != null) - return AddToCaches(userProfile); - else - return null; - } - } + + UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); + if (userProfile != null) + return AddToCaches(userProfile); + else + return null; } /// @@ -211,14 +199,10 @@ namespace OpenSim.Framework.Communications.Cache CachedUserInfo createdUserInfo = new CachedUserInfo(m_InventoryService, userProfile); lock (m_userProfilesById) - { m_userProfilesById[createdUserInfo.UserProfile.ID] = createdUserInfo; - - lock (m_userProfilesByName) - { - m_userProfilesByName[createdUserInfo.UserProfile.Name] = createdUserInfo; - } - } + + lock (m_userProfilesByName) + m_userProfilesByName[createdUserInfo.UserProfile.Name] = createdUserInfo; return createdUserInfo; } @@ -230,21 +214,25 @@ namespace OpenSim.Framework.Communications.Cache /// true if there was a profile to remove, false otherwise protected bool RemoveFromCaches(UUID userId) { + CachedUserInfo userInfo = null; lock (m_userProfilesById) { if (m_userProfilesById.ContainsKey(userId)) { - CachedUserInfo userInfo = m_userProfilesById[userId]; + userInfo = m_userProfilesById[userId]; m_userProfilesById.Remove(userId); - - lock (m_userProfilesByName) + } + } + + if (userInfo != null) + lock (m_userProfilesByName) + { + if (m_userProfilesByName.ContainsKey(userInfo.UserProfile.Name)) { m_userProfilesByName.Remove(userInfo.UserProfile.Name); + return true; } - - return true; } - } return false; } -- cgit v1.1