From 6f7825e31046fd3ea4df72147b4d28d8a7a071ce Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 14 Sep 2012 00:07:39 +0100
Subject: Don't store the unnecessary VERSIONMIN. VERSIONMAX, METHOD or UserID
(present as column PrincipalID) parameters in the Avatars table.
These are used to invoke avatar service calls but are not in themselves persistable avatar data.
---
.../Server/Handlers/Avatar/AvatarServerPostHandler.cs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'OpenSim/Server')
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
index 393584e..8cd747e 100644
--- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
@@ -137,6 +137,8 @@ namespace OpenSim.Server.Handlers.Avatar
if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult();
+ RemoveRequestParamsNotForStorage(request);
+
AvatarData avatar = new AvatarData(request);
if (m_AvatarService.SetAvatar(user, avatar))
return SuccessResult();
@@ -153,11 +155,25 @@ namespace OpenSim.Server.Handlers.Avatar
if (!UUID.TryParse(request["UserID"].ToString(), out user))
return FailureResult();
+ RemoveRequestParamsNotForStorage(request);
+
if (m_AvatarService.ResetAvatar(user))
return SuccessResult();
return FailureResult();
}
+
+ ///
+ /// Remove parameters that were used to invoke the method and should not in themselves be persisted.
+ ///
+ ///
+ private void RemoveRequestParamsNotForStorage(Dictionary request)
+ {
+ request.Remove("VERSIONMAX");
+ request.Remove("VERSIONMIN");
+ request.Remove("METHOD");
+ request.Remove("UserID");
+ }
byte[] SetItems(Dictionary request)
{
@@ -173,6 +189,8 @@ namespace OpenSim.Server.Handlers.Avatar
if (!(request["Names"] is List || request["Values"] is List))
return FailureResult();
+ RemoveRequestParamsNotForStorage(request);
+
List _names = (List)request["Names"];
names = _names.ToArray();
List _values = (List)request["Values"];
--
cgit v1.1