Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
This commit is contained in:
Melanie
2013-02-27 20:40:48 +00:00
5 changed files with 273 additions and 13 deletions

View File

@@ -83,17 +83,22 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
private Dictionary<string, UrlData> m_UrlMap =
new Dictionary<string, UrlData>();
/// <summary>
/// Maximum number of external urls that can be set up by this module.
/// </summary>
private int m_TotalUrls = 15000;
private uint m_HttpsPort = 0;
private IHttpServer m_HttpServer = null;
private IHttpServer m_HttpsServer = null;
public string ExternalHostNameForLSL { get; private set; }
/// <summary>
/// The default maximum number of urls
/// </summary>
public const int DefaultTotalUrls = 15000;
/// <summary>
/// Maximum number of external urls that can be set up by this module.
/// </summary>
public int TotalUrls { get; set; }
public Type ReplaceableInterface
{
get { return null; }
@@ -124,7 +129,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
IConfig llFunctionsConfig = config.Configs["LL-Functions"];
if (llFunctionsConfig != null)
m_TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", m_TotalUrls);
TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", DefaultTotalUrls);
else
TotalUrls = DefaultTotalUrls;
}
public void PostInitialise()
@@ -175,7 +182,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
lock (m_UrlMap)
{
if (m_UrlMap.Count >= m_TotalUrls)
if (m_UrlMap.Count >= TotalUrls)
{
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
return urlcode;
@@ -220,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
lock (m_UrlMap)
{
if (m_UrlMap.Count >= m_TotalUrls)
if (m_UrlMap.Count >= TotalUrls)
{
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
return urlcode;
@@ -355,7 +362,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public int GetFreeUrls()
{
return m_TotalUrls - m_UrlMap.Count;
lock (m_UrlMap)
return TotalUrls - m_UrlMap.Count;
}
public void ScriptRemoved(UUID itemID)