aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs6
2 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
index 091b197..29c2e8e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
@@ -42,22 +42,27 @@ using log4net;
42 42
43namespace OpenSim.Region.CoreModules.Avatar.Friends 43namespace OpenSim.Region.CoreModules.Avatar.Friends
44{ 44{
45 public class FriendsRequestHandler : BaseStreamHandlerBasicDOSProtector 45
46// public class FriendsRequestHandler : BaseStreamHandlerBasicDOSProtector
47 public class FriendsRequestHandler : BaseStreamHandler
46 { 48 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 50
49 private FriendsModule m_FriendsModule; 51 private FriendsModule m_FriendsModule;
50 52 /*
53 public FriendsRequestHandler(FriendsModule fmodule)
54 : base("POST", "/friends", new BasicDosProtectorOptions()
55 {
56 AllowXForwardedFor = true,
57 ForgetTimeSpan = TimeSpan.FromMinutes(2),
58 MaxRequestsInTimeframe = 20,
59 ReportingName = "FRIENDSDOSPROTECTOR",
60 RequestTimeSpan = TimeSpan.FromSeconds(5),
61 ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
62 })
63 */
51 public FriendsRequestHandler(FriendsModule fmodule) 64 public FriendsRequestHandler(FriendsModule fmodule)
52 : base("POST", "/friends", new BasicDosProtectorOptions() 65 : base("POST", "/friends")
53 {
54 AllowXForwardedFor = true,
55 ForgetTimeSpan = TimeSpan.FromMinutes(2),
56 MaxRequestsInTimeframe = 20,
57 ReportingName = "FRIENDSDOSPROTECTOR",
58 RequestTimeSpan = TimeSpan.FromSeconds(5),
59 ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
60 })
61 { 66 {
62 m_FriendsModule = fmodule; 67 m_FriendsModule = fmodule;
63 } 68 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index fae1e05..c042f65 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -170,6 +170,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
170 // we do this only for the root agent 170 // we do this only for the root agent
171 if (m_Friends[agentID].Refcount == 1) 171 if (m_Friends[agentID].Refcount == 1)
172 { 172 {
173 IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
174 if(uMan == null)
175 return true;
173 // We need to preload the user management cache with the names 176 // We need to preload the user management cache with the names
174 // of foreign friends, just like we do with SOPs' creators 177 // of foreign friends, just like we do with SOPs' creators
175 foreach (FriendInfo finfo in m_Friends[agentID].Friends) 178 foreach (FriendInfo finfo in m_Friends[agentID].Friends)
@@ -182,8 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
182 string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty; 185 string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
183 if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp)) 186 if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp))
184 { 187 {
185 IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>(); 188// m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend);
186 m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend);
187 uMan.AddUser(id, url + ";" + first + " " + last); 189 uMan.AddUser(id, url + ";" + first + " " + last);
188 } 190 }
189 } 191 }