diff options
author | Melanie | 2009-10-07 01:44:36 +0100 |
---|---|---|
committer | Melanie | 2009-10-07 01:44:36 +0100 |
commit | 9618c196c274fefda4437eff6d25c7a12e7a3ee1 (patch) | |
tree | b860a6f957e3d0b2504ca2ec6802b1a211e4a3de /OpenSim/Framework | |
parent | Commented noisy debugging about packet splitting (diff) | |
download | opensim-SC-9618c196c274fefda4437eff6d25c7a12e7a3ee1.zip opensim-SC-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.gz opensim-SC-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.bz2 opensim-SC-9618c196c274fefda4437eff6d25c7a12e7a3ee1.tar.xz |
Revert "Merging in diva's locking fixes"
This reverts commit 832cc685138b2244529f10b54b373c34adb4a633.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 66 | ||||
-rw-r--r-- | OpenSim/Framework/ConfigSettings.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/InventoryConfig.cs | 6 |
3 files changed, 44 insertions, 32 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index b02cf5b..9e12d948 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -128,18 +128,24 @@ namespace OpenSim.Framework.Communications.Cache | |||
128 | /// <returns>null if no user details are found</returns> | 128 | /// <returns>null if no user details are found</returns> |
129 | public CachedUserInfo GetUserDetails(string fname, string lname) | 129 | public CachedUserInfo GetUserDetails(string fname, string lname) |
130 | { | 130 | { |
131 | CachedUserInfo userInfo; | ||
132 | lock (m_userProfilesByName) | 131 | lock (m_userProfilesByName) |
133 | { | 132 | { |
133 | CachedUserInfo userInfo; | ||
134 | |||
134 | if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) | 135 | if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) |
136 | { | ||
135 | return userInfo; | 137 | return userInfo; |
138 | } | ||
139 | else | ||
140 | { | ||
141 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); | ||
142 | |||
143 | if (userProfile != null) | ||
144 | return AddToCaches(userProfile); | ||
145 | else | ||
146 | return null; | ||
147 | } | ||
136 | } | 148 | } |
137 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); | ||
138 | |||
139 | if (userProfile != null) | ||
140 | return AddToCaches(userProfile); | ||
141 | else | ||
142 | return null; | ||
143 | } | 149 | } |
144 | 150 | ||
145 | /// <summary> | 151 | /// <summary> |
@@ -154,14 +160,20 @@ namespace OpenSim.Framework.Communications.Cache | |||
154 | return null; | 160 | return null; |
155 | 161 | ||
156 | lock (m_userProfilesById) | 162 | lock (m_userProfilesById) |
163 | { | ||
157 | if (m_userProfilesById.ContainsKey(userID)) | 164 | if (m_userProfilesById.ContainsKey(userID)) |
165 | { | ||
158 | return m_userProfilesById[userID]; | 166 | return m_userProfilesById[userID]; |
159 | 167 | } | |
160 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); | 168 | else |
161 | if (userProfile != null) | 169 | { |
162 | return AddToCaches(userProfile); | 170 | UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(userID); |
163 | else | 171 | if (userProfile != null) |
164 | return null; | 172 | return AddToCaches(userProfile); |
173 | else | ||
174 | return null; | ||
175 | } | ||
176 | } | ||
165 | } | 177 | } |
166 | 178 | ||
167 | /// <summary> | 179 | /// <summary> |
@@ -199,10 +211,14 @@ namespace OpenSim.Framework.Communications.Cache | |||
199 | CachedUserInfo createdUserInfo = new CachedUserInfo(m_InventoryService, userProfile); | 211 | CachedUserInfo createdUserInfo = new CachedUserInfo(m_InventoryService, userProfile); |
200 | 212 | ||
201 | lock (m_userProfilesById) | 213 | lock (m_userProfilesById) |
214 | { | ||
202 | m_userProfilesById[createdUserInfo.UserProfile.ID] = createdUserInfo; | 215 | m_userProfilesById[createdUserInfo.UserProfile.ID] = createdUserInfo; |
203 | 216 | ||
204 | lock (m_userProfilesByName) | 217 | lock (m_userProfilesByName) |
205 | m_userProfilesByName[createdUserInfo.UserProfile.Name] = createdUserInfo; | 218 | { |
219 | m_userProfilesByName[createdUserInfo.UserProfile.Name] = createdUserInfo; | ||
220 | } | ||
221 | } | ||
206 | 222 | ||
207 | return createdUserInfo; | 223 | return createdUserInfo; |
208 | } | 224 | } |
@@ -214,25 +230,21 @@ namespace OpenSim.Framework.Communications.Cache | |||
214 | /// <returns>true if there was a profile to remove, false otherwise</returns> | 230 | /// <returns>true if there was a profile to remove, false otherwise</returns> |
215 | protected bool RemoveFromCaches(UUID userId) | 231 | protected bool RemoveFromCaches(UUID userId) |
216 | { | 232 | { |
217 | CachedUserInfo userInfo = null; | ||
218 | lock (m_userProfilesById) | 233 | lock (m_userProfilesById) |
219 | { | 234 | { |
220 | if (m_userProfilesById.ContainsKey(userId)) | 235 | if (m_userProfilesById.ContainsKey(userId)) |
221 | { | 236 | { |
222 | userInfo = m_userProfilesById[userId]; | 237 | CachedUserInfo userInfo = m_userProfilesById[userId]; |
223 | m_userProfilesById.Remove(userId); | 238 | m_userProfilesById.Remove(userId); |
224 | } | 239 | |
225 | } | 240 | lock (m_userProfilesByName) |
226 | |||
227 | if (userInfo != null) | ||
228 | lock (m_userProfilesByName) | ||
229 | { | ||
230 | if (m_userProfilesByName.ContainsKey(userInfo.UserProfile.Name)) | ||
231 | { | 241 | { |
232 | m_userProfilesByName.Remove(userInfo.UserProfile.Name); | 242 | m_userProfilesByName.Remove(userInfo.UserProfile.Name); |
233 | return true; | ||
234 | } | 243 | } |
244 | |||
245 | return true; | ||
235 | } | 246 | } |
247 | } | ||
236 | 248 | ||
237 | return false; | 249 | return false; |
238 | } | 250 | } |
diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs index 32415e0..93efffa 100644 --- a/OpenSim/Framework/ConfigSettings.cs +++ b/OpenSim/Framework/ConfigSettings.cs | |||
@@ -168,7 +168,7 @@ namespace OpenSim.Framework | |||
168 | public const bool DefaultUserServerHttpSSL = false; | 168 | public const bool DefaultUserServerHttpSSL = false; |
169 | public const uint DefaultMessageServerHttpPort = 8006; | 169 | public const uint DefaultMessageServerHttpPort = 8006; |
170 | public const bool DefaultMessageServerHttpSSL = false; | 170 | public const bool DefaultMessageServerHttpSSL = false; |
171 | public const uint DefaultGridServerHttpPort = 8003; | 171 | public const uint DefaultGridServerHttpPort = 8001; |
172 | public const uint DefaultInventoryServerHttpPort = 8003; | 172 | public const uint DefaultInventoryServerHttpPort = 8004; |
173 | } | 173 | } |
174 | } | 174 | } |
diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index dd207ad..f539d55 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs | |||
@@ -56,15 +56,15 @@ namespace OpenSim.Framework | |||
56 | m_configMember.addConfigurationOption("default_inventory_server", | 56 | m_configMember.addConfigurationOption("default_inventory_server", |
57 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 57 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
58 | "Default Inventory Server URI (this server's external name)", | 58 | "Default Inventory Server URI (this server's external name)", |
59 | "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort, false); | 59 | "http://127.0.0.1:8004", false); |
60 | m_configMember.addConfigurationOption("default_user_server", | 60 | m_configMember.addConfigurationOption("default_user_server", |
61 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 61 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
62 | "Default User Server URI", | 62 | "Default User Server URI", |
63 | "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort, false); | 63 | "http://127.0.0.1:8002", false); |
64 | m_configMember.addConfigurationOption("default_asset_server", | 64 | m_configMember.addConfigurationOption("default_asset_server", |
65 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 65 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
66 | "Default Asset Server URI", | 66 | "Default Asset Server URI", |
67 | "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort, false); | 67 | "http://127.0.0.1:8003", false); |
68 | m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 68 | m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
69 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | 69 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); |
70 | m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 70 | m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |