27 using OpenSim.Framework;
30 namespace OpenSim.Framework.Servers.HttpServer
47 : base(httpMethod, path, name, description)
58 string clientstring = GetClientString(httpRequest);
59 string endpoint = GetRemoteAddr(httpRequest);
60 if (_dosProtector.Process(clientstring, endpoint))
61 result = ProcessRequest(path, request, httpRequest, httpResponse);
63 result = ThrottledRequest(path, request, httpRequest, httpResponse);
64 if (_options.MaxConcurrentSessions > 0)
65 _dosProtector.ProcessEnd(clientstring, endpoint);
87 string remoteaddr = string.Empty;
88 if (httpRequest.
Headers[
"remote_addr"] != null)
89 remoteaddr = httpRequest.Headers[
"remote_addr"];
94 private string GetClientString(IOSHttpRequest httpRequest)
96 string clientstring = string.Empty;
98 if (_options.AllowXForwardedFor && httpRequest.Headers[
"x-forwarded-for"] != null)
99 clientstring = httpRequest.Headers[
"x-forwarded-for"];
101 clientstring = GetRemoteAddr(httpRequest);
virtual byte[] ThrottledRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, BasicDosProtectorOptions options)
virtual byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
NameValueCollection Headers
BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, string name, string description, BasicDosProtectorOptions options)
virtual byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
BaseStreamHandlerBasicDOSProtector Base streamed request handler.