public void Initialise(IConfigSource config)
        {
            m_proxyurl     = config.Configs["Startup"].GetString("HttpProxy");
            m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");

            HttpRequestClass.HttpBodyMaxLenMAX = config.Configs["Network"].GetInt("HttpBodyMaxLenMAX", 16384);


            m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config);
            int maxThreads = 15;

            IConfig httpConfig = config.Configs["HttpRequestModule"];

            if (httpConfig != null)
            {
                maxThreads = httpConfig.GetInt("MaxPoolThreads", maxThreads);
            }

            m_pendingRequests = new Dictionary <UUID, HttpRequestClass>();

            // First instance sets this up for all sims
            if (ThreadPool == null)
            {
                STPStartInfo startInfo = new STPStartInfo();
                startInfo.IdleTimeout      = 20000;
                startInfo.MaxWorkerThreads = maxThreads;
                startInfo.MinWorkerThreads = 1;
                startInfo.ThreadPriority   = ThreadPriority.BelowNormal;
                startInfo.StartSuspended   = true;
                startInfo.ThreadPoolName   = "ScriptsHttpReq";

                ThreadPool = new SmartThreadPool(startInfo);
                ThreadPool.Start();
            }
        }
        public void Initialise(IConfigSource config)
        {
            m_proxyurl     = config.Configs["Startup"].GetString("HttpProxy");
            m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");

            m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config);

            m_pendingRequests = new Dictionary <UUID, HttpRequestClass>();
        }
        public void Initialise(IConfigSource config)
        {
            m_proxyurl     = config.Configs["Startup"].GetString("HttpProxy");
            m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");

            HttpRequestClass.HttpBodyMaxLenMAX = config.Configs["Network"].GetInt("HttpBodyMaxLenMAX", 16384);

            m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config);

            int     maxThreads = 8;
            IConfig httpConfig = config.Configs["ScriptsHttpRequestModule"];

            if (httpConfig != null)
            {
                maxThreads        = httpConfig.GetInt("MaxPoolThreads", maxThreads);
                m_primBurst       = httpConfig.GetFloat("PrimRequestsBurst", m_primBurst);
                m_primPerSec      = httpConfig.GetFloat("PrimRequestsPerSec", m_primPerSec);
                m_primOwnerBurst  = httpConfig.GetFloat("PrimOwnerRequestsBurst", m_primOwnerBurst);
                m_primOwnerPerSec = httpConfig.GetFloat("PrimOwnerRequestsPerSec", m_primOwnerPerSec);
                m_httpTimeout     = httpConfig.GetInt("RequestsTimeOut", m_httpTimeout);
                if (m_httpTimeout > 60000)
                {
                    m_httpTimeout = 60000;
                }
                else if (m_httpTimeout < 200)
                {
                    m_httpTimeout = 200;
                }
            }

            m_pendingRequests       = new Dictionary <UUID, HttpRequestClass>();
            m_CompletedRequests     = new ConcurrentQueue <HttpRequestClass>();
            m_RequestsThrottle      = new ConcurrentDictionary <uint, ThrottleData>();
            m_OwnerRequestsThrottle = new ConcurrentDictionary <UUID, ThrottleData>();

            // First instance sets this up for all sims
            if (ThreadPool == null)
            {
                STPStartInfo startInfo = new STPStartInfo()
                {
                    IdleTimeout      = 2000,
                    MaxWorkerThreads = maxThreads,
                    MinWorkerThreads = 0,
                    ThreadPriority   = ThreadPriority.Normal,
                    StartSuspended   = true,
                    ThreadPoolName   = "ScriptsHttpReq"
                };

                ThreadPool = new SmartThreadPool(startInfo);
                ThreadPool.Start();
            }
        }
Esempio n. 4
0
        public void Initialise(IConfigSource config)
        {
            lock (m_mainLock)
            {
                // shared items
                if (m_jobEngine == null)
                {
                    m_proxyurl     = config.Configs["Startup"].GetString("HttpProxy");
                    m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");

                    HttpRequestClass.HttpBodyMaxLenMAX = config.Configs["Network"].GetInt("HttpBodyMaxLenMAX", 16384);

                    m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config);

                    int     maxThreads = 8;
                    IConfig httpConfig = config.Configs["ScriptsHttpRequestModule"];
                    if (httpConfig != null)
                    {
                        maxThreads        = httpConfig.GetInt("MaxPoolThreads", maxThreads);
                        m_primBurst       = httpConfig.GetFloat("PrimRequestsBurst", m_primBurst);
                        m_primPerSec      = httpConfig.GetFloat("PrimRequestsPerSec", m_primPerSec);
                        m_primOwnerBurst  = httpConfig.GetFloat("PrimOwnerRequestsBurst", m_primOwnerBurst);
                        m_primOwnerPerSec = httpConfig.GetFloat("PrimOwnerRequestsPerSec", m_primOwnerPerSec);
                        m_httpTimeout     = httpConfig.GetInt("RequestsTimeOut", m_httpTimeout);
                        if (m_httpTimeout > 60000)
                        {
                            m_httpTimeout = 60000;
                        }
                        else if (m_httpTimeout < 200)
                        {
                            m_httpTimeout = 200;
                        }
                    }

                    m_pendingRequests = new Dictionary <UUID, HttpRequestClass>();

                    m_jobEngine = new JobEngine("ScriptsHttpReq", "ScriptsHttpReq", 2000, maxThreads);
                    m_jobEngine.Start();
                }
            }
        }
Esempio n. 5
0
 public void Initialise(IConfigSource config)
 {
     m_outboundUrlFilter = new OutboundUrlFilter("Script dynamic texture image module", config);
     m_proxyurl          = config.Configs["Startup"].GetString("HttpProxy");
     m_proxyexcepts      = config.Configs["Startup"].GetString("HttpProxyExceptions");
 }
Esempio n. 6
0
        public void Initialise(IConfigSource config)
        {
            m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
            m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");

            m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config);

            m_pendingRequests = new Dictionary<UUID, HttpRequestClass>();
        }