mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
xmlrpcgroups: make use of a forgotten GetMemberGroupProfilemethod, put back xmlrpc cache since it is necessary to prevent folish viewers flooding
This commit is contained in:
@@ -181,9 +181,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30);
|
||||
|
||||
// disable cache until it is fixed
|
||||
m_cacheTimeout = 0;
|
||||
|
||||
if (m_cacheTimeout == 0)
|
||||
{
|
||||
m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled.");
|
||||
@@ -385,10 +382,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
GroupMembershipData MemberInfo = GetAgentGroupMembership(requestingAgentID, AgentID, GroupID);
|
||||
GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData);
|
||||
|
||||
MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle;
|
||||
MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
|
||||
|
||||
if(MemberInfo != null)
|
||||
{
|
||||
MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle;
|
||||
MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
|
||||
}
|
||||
return MemberGroupProfile;
|
||||
}
|
||||
|
||||
@@ -977,12 +975,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
try
|
||||
{
|
||||
resp = req.Send(m_groupsServerURI, 30000);
|
||||
|
||||
if ((m_cacheTimeout > 0) && (CacheKey != null))
|
||||
{
|
||||
m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
}
|
||||
resp = req.Send(m_groupsServerURI);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1004,12 +997,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", key, param[key].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_cacheTimeout > 0) && (CacheKey != null))
|
||||
{
|
||||
m_memoryCache.AddOrUpdate(CacheKey, resp, 10.0);
|
||||
}
|
||||
Hashtable respData = new Hashtable();
|
||||
respData.Add("error", e.ToString());
|
||||
return respData;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_cacheTimeout > 0) && (CacheKey != null))
|
||||
{
|
||||
m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
|
||||
}
|
||||
|
||||
if (resp.Value is Hashtable)
|
||||
{
|
||||
Hashtable respData = (Hashtable)resp.Value;
|
||||
@@ -1138,6 +1141,7 @@ namespace Nwc.XmlRpc
|
||||
request.ContentType = "text/xml";
|
||||
request.AllowWriteStreamBuffering = true;
|
||||
request.KeepAlive = !_disableKeepAlive;
|
||||
request.Timeout = 30000;
|
||||
|
||||
using (Stream stream = request.GetRequestStream())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user