aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
diff options
context:
space:
mode:
authorMelanie2013-02-27 20:40:48 +0000
committerMelanie2013-02-27 20:40:48 +0000
commitba0819be9ee4574e9cc5c05e94d21b449debba0a (patch)
treeee4b494dabe14ea227d662844f483669d96a31d5 /OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
parentMerge branch 'master' into careminster (diff)
parentminor: remove some mono compiler warnings in script regression tests (diff)
downloadopensim-SC_OLD-ba0819be9ee4574e9cc5c05e94d21b449debba0a.zip
opensim-SC_OLD-ba0819be9ee4574e9cc5c05e94d21b449debba0a.tar.gz
opensim-SC_OLD-ba0819be9ee4574e9cc5c05e94d21b449debba0a.tar.bz2
opensim-SC_OLD-ba0819be9ee4574e9cc5c05e94d21b449debba0a.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs26
1 files changed, 17 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index b9c373b..ffb8e85 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -83,17 +83,22 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
83 private Dictionary<string, UrlData> m_UrlMap = 83 private Dictionary<string, UrlData> m_UrlMap =
84 new Dictionary<string, UrlData>(); 84 new Dictionary<string, UrlData>();
85 85
86 /// <summary>
87 /// Maximum number of external urls that can be set up by this module.
88 /// </summary>
89 private int m_TotalUrls = 15000;
90
91 private uint m_HttpsPort = 0; 86 private uint m_HttpsPort = 0;
92 private IHttpServer m_HttpServer = null; 87 private IHttpServer m_HttpServer = null;
93 private IHttpServer m_HttpsServer = null; 88 private IHttpServer m_HttpsServer = null;
94 89
95 public string ExternalHostNameForLSL { get; private set; } 90 public string ExternalHostNameForLSL { get; private set; }
96 91
92 /// <summary>
93 /// The default maximum number of urls
94 /// </summary>
95 public const int DefaultTotalUrls = 15000;
96
97 /// <summary>
98 /// Maximum number of external urls that can be set up by this module.
99 /// </summary>
100 public int TotalUrls { get; set; }
101
97 public Type ReplaceableInterface 102 public Type ReplaceableInterface
98 { 103 {
99 get { return null; } 104 get { return null; }
@@ -124,7 +129,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
124 IConfig llFunctionsConfig = config.Configs["LL-Functions"]; 129 IConfig llFunctionsConfig = config.Configs["LL-Functions"];
125 130
126 if (llFunctionsConfig != null) 131 if (llFunctionsConfig != null)
127 m_TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", m_TotalUrls); 132 TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", DefaultTotalUrls);
133 else
134 TotalUrls = DefaultTotalUrls;
128 } 135 }
129 136
130 public void PostInitialise() 137 public void PostInitialise()
@@ -175,7 +182,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
175 182
176 lock (m_UrlMap) 183 lock (m_UrlMap)
177 { 184 {
178 if (m_UrlMap.Count >= m_TotalUrls) 185 if (m_UrlMap.Count >= TotalUrls)
179 { 186 {
180 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 187 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
181 return urlcode; 188 return urlcode;
@@ -220,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
220 227
221 lock (m_UrlMap) 228 lock (m_UrlMap)
222 { 229 {
223 if (m_UrlMap.Count >= m_TotalUrls) 230 if (m_UrlMap.Count >= TotalUrls)
224 { 231 {
225 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 232 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
226 return urlcode; 233 return urlcode;
@@ -355,7 +362,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
355 362
356 public int GetFreeUrls() 363 public int GetFreeUrls()
357 { 364 {
358 return m_TotalUrls - m_UrlMap.Count; 365 lock (m_UrlMap)
366 return TotalUrls - m_UrlMap.Count;
359 } 367 }
360 368
361 public void ScriptRemoved(UUID itemID) 369 public void ScriptRemoved(UUID itemID)