public XmlRpcBasicDOSProtector(XmlRpcMethod normalMethod, XmlRpcMethod throttledMethod, BasicDosProtectorOptions options) { _normalMethod = normalMethod; _throttledMethod = throttledMethod; _options = options; _dosProtector = new BasicDOSProtector(_options); }
/// <summary> /// Instantiate an XmlRpc handler. /// </summary> /// <param name="handler">XmlRpcMethod /// delegate</param> /// <param name="methodName">XmlRpc method name</param> /// <param name="path">XmlRpc path prefix (regular expression)</param> /// <param name="headers">Dictionary with header names and /// regular expressions to match content of headers</param> /// <param name="whitelist">IP whitelist of remote end points /// to accept (regular expression)</param> /// <remarks> /// Except for handler and methodName, all other parameters /// can be null, in which case they are not taken into account /// when the handler is being looked up. /// </remarks> public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, Dictionary <string, Regex> headers, Regex whitelist) : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled), whitelist) { _handler = handler; _methodName = methodName; }
public XmlRpcBasicDOSProtector(XmlRpcMethod normalMethod, XmlRpcMethod throttledMethod,BasicDosProtectorOptions options) { _normalMethod = normalMethod; _throttledMethod = throttledMethod; _options = options; _dosProtector = new BasicDOSProtector(_options); }
// Returns a XmlRpcMethod object from the incoming stream public object Deserialize(Stream stream) { XmlTextReader tr = new XmlTextReader(stream); XmlRpcMethod method = new XmlRpcMethod(); method.Read(tr); return(method); }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { if (!this.m_rpcHandlers.ContainsKey(method)) { this.m_rpcHandlers.Add(method, handler); return true; } //must already have a handler for that path so return false return false; }
public ReflectiveXmlRpcHandler(AbstractReflectiveHandlerMapping mapping, ITypeConverterFactory typeConverterFactory, Type type, IXmlRpcTargetProvider provider, MethodInfo[] methods) { _mapping = mapping; _type = type; _methods = new XmlRpcMethod[methods.Length]; for (Int32 i = 0; i < methods.Length; i++) { _methods[i] = new XmlRpcMethod(methods[i], typeConverterFactory); } _targetProvider = provider; }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { if (!this.m_rpcHandlers.ContainsKey(method)) { this.m_rpcHandlers.Add(method, handler); return(true); } //must already have a handler for that path so return false return(false); }
public Object Execute(IXmlRpcRequest request) { if (_mapping.AuthenticationHandler != null && !_mapping.AuthenticationHandler.IsAuthorized(request)) { throw new XmlRpcException("Not authorized"); } Object[] args = request.Parameters ?? Empty; XmlRpcMethod method = GetMethod(args); ConvertParams(method.TypeConverters, args); //return Invoke(method.Method, _targetProvider == null ? request.Target : _targetProvider.GetTarget(request), request.Parameters); if (request.Target == null && _targetProvider != null) { request.Target = _targetProvider.GetTarget(request); } return(Invoke(method.Method, request.Target, args)); }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { lock (m_rpcHandlers) m_rpcHandlers[method] = handler; return true; }
internal bool TryGetXMLHandler(string methodName, out XmlRpcMethod handler) { lock (m_rpcHandlers) return m_rpcHandlers.TryGetValue(methodName, out handler); }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { lock (m_rpcHandlers) m_rpcHandlers[method] = handler; return(true); }
public XmlRpcStreamHandler(string httpMethod, string path, XmlRpcMethod xmlrpcMethod) : base(httpMethod, path) { m_xmlrpcMethod = xmlrpcMethod; }
/// <summary> /// Instantiate an XmlRpc handler. /// </summary> /// <param name="handler">XmlRpcMethod /// delegate</param> /// <param name="methodName">XmlRpc method name</param> public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName) : this(handler, methodName, null, null, null) { }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) { return AddXmlRPCHandler(method, handler, true); }
internal bool TryGetXMLHandler(string methodName, out XmlRpcMethod handler) { lock (m_rpcHandlers) return(m_rpcHandlers.TryGetValue(methodName, out handler)); }
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive) { lock (m_rpcHandlers) { m_rpcHandlers[method] = handler; m_rpcHandlersKeepAlive[method] = keepAlive; // default } return true; }
/// <summary> /// Instantiate an XmlRpc handler. /// </summary> /// <param name="handler">XmlRpcMethod /// delegate</param> /// <param name="methodName">XmlRpc method name</param> /// <param name="path">XmlRpc path prefix (regular expression)</param> /// <param name="headers">Dictionary with header names and /// regular expressions to match content of headers</param> /// <param name="whitelist">IP whitelist of remote end points /// to accept (regular expression)</param> /// <remarks> /// Except for handler and methodName, all other parameters /// can be null, in which case they are not taken into account /// when the handler is being looked up. /// </remarks> public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, Dictionary<string, Regex> headers, Regex whitelist) : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled), whitelist) { _handler = handler; _methodName = methodName; }