aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/BasicDOSProtector.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/BasicDOSProtector.cs
parentAdd a build script. (diff)
downloadopensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/BasicDOSProtector.cs')
-rw-r--r--OpenSim/Framework/BasicDOSProtector.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Framework/BasicDOSProtector.cs b/OpenSim/Framework/BasicDOSProtector.cs
index 89bfa94..f1ff18f 100644
--- a/OpenSim/Framework/BasicDOSProtector.cs
+++ b/OpenSim/Framework/BasicDOSProtector.cs
@@ -31,7 +31,7 @@ using log4net;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 34
35 public class BasicDOSProtector 35 public class BasicDOSProtector
36 { 36 {
37 public enum ThrottleAction 37 public enum ThrottleAction
@@ -43,7 +43,7 @@ namespace OpenSim.Framework
43 private readonly BasicDosProtectorOptions _options; 43 private readonly BasicDosProtectorOptions _options;
44 private readonly Dictionary<string, CircularBuffer<int>> _deeperInspection; // per client request checker 44 private readonly Dictionary<string, CircularBuffer<int>> _deeperInspection; // per client request checker
45 private readonly Dictionary<string, int> _tempBlocked; // blocked list 45 private readonly Dictionary<string, int> _tempBlocked; // blocked list
46 private readonly Dictionary<string, int> _sessions; 46 private readonly Dictionary<string, int> _sessions;
47 private readonly System.Timers.Timer _forgetTimer; // Cleanup timer 47 private readonly System.Timers.Timer _forgetTimer; // Cleanup timer
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 private readonly System.Threading.ReaderWriterLockSlim _blockLockSlim = new System.Threading.ReaderWriterLockSlim(); 49 private readonly System.Threading.ReaderWriterLockSlim _blockLockSlim = new System.Threading.ReaderWriterLockSlim();
@@ -133,7 +133,7 @@ namespace OpenSim.Framework
133 else 133 else
134 throw new System.Security.SecurityException("Throttled"); 134 throw new System.Security.SecurityException("Throttled");
135 } 135 }
136 136
137 _blockLockSlim.ExitReadLock(); 137 _blockLockSlim.ExitReadLock();
138 138
139 lock (_generalRequestTimes) 139 lock (_generalRequestTimes)
@@ -169,10 +169,10 @@ namespace OpenSim.Framework
169 _blockLockSlim.ExitWriteLock(); 169 _blockLockSlim.ExitWriteLock();
170 170
171 } 171 }
172 172
173 173
174 } 174 }
175 else 175 else
176 ProcessConcurrency(key, endpoint); 176 ProcessConcurrency(key, endpoint);
177 } 177 }
178 if (_generalRequestTimes.Size == _generalRequestTimes.Capacity && 178 if (_generalRequestTimes.Size == _generalRequestTimes.Capacity &&
@@ -194,7 +194,7 @@ namespace OpenSim.Framework
194 _sessionLockSlim.EnterWriteLock(); 194 _sessionLockSlim.EnterWriteLock();
195 if (_sessions.ContainsKey(key)) 195 if (_sessions.ContainsKey(key))
196 _sessions[key] = _sessions[key] + 1; 196 _sessions[key] = _sessions[key] + 1;
197 else 197 else
198 _sessions.Add(key,1); 198 _sessions.Add(key,1);
199 _sessionLockSlim.ExitWriteLock(); 199 _sessionLockSlim.ExitWriteLock();
200 } 200 }
@@ -209,7 +209,7 @@ namespace OpenSim.Framework
209 } 209 }
210 else 210 else
211 _sessions.Add(key, 1); 211 _sessions.Add(key, 1);
212 212
213 _sessionLockSlim.ExitWriteLock(); 213 _sessionLockSlim.ExitWriteLock();
214 } 214 }
215 215