aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
diff options
context:
space:
mode:
authorteravus2013-10-07 21:35:55 -0500
committerteravus2013-10-07 21:35:55 -0500
commitf76cc6036ebf446553ee5201321879538dafe3b2 (patch)
tree7e33eee605c3baf04a16422f06ac3986f0f27eaa /OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
parent* Added a unique and interesting WebSocket grid login processor by hijacking ... (diff)
downloadopensim-SC_OLD-f76cc6036ebf446553ee5201321879538dafe3b2.zip
opensim-SC_OLD-f76cc6036ebf446553ee5201321879538dafe3b2.tar.gz
opensim-SC_OLD-f76cc6036ebf446553ee5201321879538dafe3b2.tar.bz2
opensim-SC_OLD-f76cc6036ebf446553ee5201321879538dafe3b2.tar.xz
* Added a Basic DOS protection container/base object for the most common HTTP Server handlers. XMLRPC Handler, GenericHttpHandler and <Various>StreamHandler
* Applied the XmlRpcBasicDOSProtector.cs to the login service as both an example, and good practice. * Applied the BaseStreamHandlerBasicDOSProtector.cs to the friends service as an example of the DOS Protector on StreamHandlers * Added CircularBuffer, used for CPU and Memory friendly rate monitoring. * DosProtector has 2 states, 1. Just Check for blocked users and check general velocity, 2. Track velocity per user, It only jumps to 2 if it's getting a lot of requests, and state 1 is about as resource friendly as if it wasn't even there.
Diffstat (limited to 'OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs')
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index 8b23a83..0bd0235 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -42,14 +42,22 @@ using OpenSim.Framework.Servers.HttpServer;
42 42
43namespace OpenSim.Server.Handlers.Asset 43namespace OpenSim.Server.Handlers.Asset
44{ 44{
45 public class AssetServerGetHandler : BaseStreamHandler 45 public class AssetServerGetHandler : BaseStreamHandlerBasicDOSProtector
46 { 46 {
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private IAssetService m_AssetService; 49 private IAssetService m_AssetService;
50 50
51 public AssetServerGetHandler(IAssetService service) : 51 public AssetServerGetHandler(IAssetService service) :
52 base("GET", "/assets") 52 base("GET", "/assets",new BasicDosProtectorOptions()
53 {
54 AllowXForwardedFor = true,
55 ForgetTimeSpan = TimeSpan.FromSeconds(2),
56 MaxRequestsInTimeframe = 5,
57 ReportingName = "ASSETGETDOSPROTECTOR",
58 RequestTimeSpan = TimeSpan.FromSeconds(5),
59 ThrottledAction = ThrottleAction.DoThrottledMethod
60 })
53 { 61 {
54 m_AssetService = service; 62 m_AssetService = service;
55 } 63 }