Esempio n. 1
0
        public virtual byte[] Handle(
            string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
        {
            byte[] result;
            RequestsReceived++;
            string clientstring = GetClientString(httpRequest);
            string endpoint     = GetRemoteAddr(httpRequest);

            if (_dosProtector.Process(clientstring, endpoint))
            {
                result = ProcessRequest(path, request, httpRequest, httpResponse);
            }
            else
            {
                result = ThrottledRequest(path, request, httpRequest, httpResponse);
            }
            if (_options.MaxConcurrentSessions > 0)
            {
                _dosProtector.ProcessEnd(clientstring, endpoint);
            }

            RequestsHandled++;

            return(result);
        }
        public XmlRpcResponse Process(XmlRpcRequest request, IPEndPoint client)
        {
            XmlRpcResponse resp         = null;
            string         clientstring = GetClientString(request, client);
            string         endpoint     = GetEndPoint(request, client);

            if (_dosProtector.Process(clientstring, endpoint))
            {
                resp = _normalMethod(request, client);
            }
            else
            {
                resp = _throttledMethod(request, client);
            }
            if (_options.MaxConcurrentSessions > 0)
            {
                _dosProtector.ProcessEnd(clientstring, endpoint);
            }
            return(resp);
        }
        public Hashtable Process(Hashtable request)
        {
            Hashtable process      = null;
            string    clientstring = GetClientString(request);
            string    endpoint     = GetRemoteAddr(request);

            if (_dosProtector.Process(clientstring, endpoint))
            {
                process = _normalMethod(request);
            }
            else
            {
                process = _throttledMethod(request);
            }

            if (_options.MaxConcurrentSessions > 0)
            {
                _dosProtector.ProcessEnd(clientstring, endpoint);
            }

            return(process);
        }