aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs8
-rw-r--r--OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs14
-rw-r--r--OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs7
3 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs
index 9b8b8c2..1b88545 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs
@@ -55,12 +55,14 @@ namespace OpenSim.Framework.Servers.HttpServer
55 { 55 {
56 byte[] result; 56 byte[] result;
57 RequestsReceived++; 57 RequestsReceived++;
58 58 string clientstring = GetClientString(httpRequest);
59 if (_dosProtector.Process(GetClientString(httpRequest), GetRemoteAddr(httpRequest))) 59 string endpoint = GetRemoteAddr(httpRequest);
60 if (_dosProtector.Process(clientstring, endpoint))
60 result = ProcessRequest(path, request, httpRequest, httpResponse); 61 result = ProcessRequest(path, request, httpRequest, httpResponse);
61 else 62 else
62 result = ThrottledRequest(path, request, httpRequest, httpResponse); 63 result = ThrottledRequest(path, request, httpRequest, httpResponse);
63 64 if (_options.MaxConcurrentSessions > 0)
65 _dosProtector.ProcessEnd(clientstring, endpoint);
64 66
65 RequestsHandled++; 67 RequestsHandled++;
66 68
diff --git a/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs
index 39c98b4..cd4b8ff 100644
--- a/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs
+++ b/OpenSim/Framework/Servers/HttpServer/GenericHTTPBasicDOSProtector.cs
@@ -47,10 +47,18 @@ namespace OpenSim.Framework.Servers.HttpServer
47 } 47 }
48 public Hashtable Process(Hashtable request) 48 public Hashtable Process(Hashtable request)
49 { 49 {
50 if (_dosProtector.Process(GetClientString(request), GetRemoteAddr(request))) 50 Hashtable process = null;
51 return _normalMethod(request); 51 string clientstring= GetClientString(request);
52 string endpoint = GetRemoteAddr(request);
53 if (_dosProtector.Process(clientstring, endpoint))
54 process = _normalMethod(request);
52 else 55 else
53 return _throttledMethod(request); 56 process = _throttledMethod(request);
57
58 if (_options.MaxConcurrentSessions>0)
59 _dosProtector.ProcessEnd(clientstring, endpoint);
60
61 return process;
54 } 62 }
55 63
56 private string GetRemoteAddr(Hashtable request) 64 private string GetRemoteAddr(Hashtable request)
diff --git a/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs
index bc7efb6..f212208 100644
--- a/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs
+++ b/OpenSim/Framework/Servers/HttpServer/XmlRpcBasicDOSProtector.cs
@@ -53,11 +53,14 @@ namespace OpenSim.Framework.Servers.HttpServer
53 { 53 {
54 54
55 XmlRpcResponse resp = null; 55 XmlRpcResponse resp = null;
56 if (_dosProtector.Process(GetClientString(request, client), GetEndPoint(request, client))) 56 string clientstring = GetClientString(request, client);
57 string endpoint = GetEndPoint(request, client);
58 if (_dosProtector.Process(clientstring, endpoint))
57 resp = _normalMethod(request, client); 59 resp = _normalMethod(request, client);
58 else 60 else
59 resp = _throttledMethod(request, client); 61 resp = _throttledMethod(request, client);
60 62 if (_options.MaxConcurrentSessions > 0)
63 _dosProtector.ProcessEnd(clientstring, endpoint);
61 return resp; 64 return resp;
62 } 65 }
63 66