From 65c5efe43b68700bad94076d4cd421160203c5de Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 16 May 2008 01:22:11 +0000 Subject: Formatting cleanup. --- .../Communications/Limit/RepeatLimitStrategy.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs') diff --git a/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs b/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs index dfa05fa..bb72029 100644 --- a/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs +++ b/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs @@ -31,14 +31,14 @@ namespace OpenSim.Framework.Communications.Limit { /// /// Limit requests by discarding them after they've been repeated a certain number of times. - /// + /// public class RepeatLimitStrategy : IRequestLimitStrategy { /// /// Record each asset request that we're notified about. /// private readonly Dictionary requestCounts = new Dictionary(); - + /// /// The maximum number of requests that can be made before we drop subsequent requests. /// @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Limit { get { return m_maxRequests; } } - + /// /// The maximum number of requests that may be served before all further /// requests are dropped. @@ -55,52 +55,52 @@ namespace OpenSim.Framework.Communications.Limit { m_maxRequests = maxRequests; } - + /// /// /// public bool AllowRequest(TId id) - { + { if (requestCounts.ContainsKey(id)) { requestCounts[id] += 1; - + if (requestCounts[id] > m_maxRequests) - { + { return false; - } + } } - + return true; } - + /// /// - /// + /// public bool IsFirstRefusal(TId id) { if (requestCounts.ContainsKey(id) && m_maxRequests + 1 == requestCounts[id]) { return true; - } - + } + return false; } - + /// /// - /// + /// public void MonitorRequests(TId id) { if (!IsMonitoringRequests(id)) { requestCounts.Add(id, 1); - } - } - + } + } + /// /// - /// + /// public bool IsMonitoringRequests(TId id) { return requestCounts.ContainsKey(id); -- cgit v1.1