diff options
author | Mic Bowman | 2011-04-12 12:38:47 -0700 |
---|---|---|
committer | Mic Bowman | 2011-04-12 12:38:47 -0700 |
commit | 0e97629ee7b24ede98983ad5cebc590fc0b7b74f (patch) | |
tree | 51f38b9ad75a09ce70ef00df9717444aa1e670f7 /OpenSim/Region | |
parent | New tokenbucket algorithm. This one provides fair sharing of the queues (diff) | |
parent | minor: add a bit more method doc to IInventoryService.GetItem() (diff) | |
download | opensim-SC-0e97629ee7b24ede98983ad5cebc590fc0b7b74f.zip opensim-SC-0e97629ee7b24ede98983ad5cebc590fc0b7b74f.tar.gz opensim-SC-0e97629ee7b24ede98983ad5cebc590fc0b7b74f.tar.bz2 opensim-SC-0e97629ee7b24ede98983ad5cebc590fc0b7b74f.tar.xz |
Merge branch 'master' into queuetest
Diffstat (limited to '')
4 files changed, 54 insertions, 23 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index ec1fb04..39004d4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -341,10 +341,15 @@ namespace OpenSim | |||
341 | 341 | ||
342 | m_console.Commands.AddCommand("region", false, "config get", | 342 | m_console.Commands.AddCommand("region", false, "config get", |
343 | "config get [<section>] [<key>]", | 343 | "config get [<section>] [<key>]", |
344 | "Show a config option", | 344 | "Synonym for config show", |
345 | HandleConfig); | ||
346 | |||
347 | m_console.Commands.AddCommand("region", false, "config show", | ||
348 | "config show [<section>] [<key>]", | ||
349 | "Show config information", | ||
345 | "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine | 350 | "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine |
346 | + "If a section is given but not a field, then all fields in that section are printed.", | 351 | + "If a section is given but not a field, then all fields in that section are printed.", |
347 | HandleConfig); | 352 | HandleConfig); |
348 | 353 | ||
349 | m_console.Commands.AddCommand("region", false, "config save", | 354 | m_console.Commands.AddCommand("region", false, "config save", |
350 | "config save <path>", | 355 | "config save <path>", |
@@ -593,7 +598,9 @@ namespace OpenSim | |||
593 | 598 | ||
594 | if (cmdparams.Length > 0) | 599 | if (cmdparams.Length > 0) |
595 | { | 600 | { |
596 | switch (cmdparams[0].ToLower()) | 601 | string firstParam = cmdparams[0].ToLower(); |
602 | |||
603 | switch (firstParam) | ||
597 | { | 604 | { |
598 | case "set": | 605 | case "set": |
599 | if (cmdparams.Length < 4) | 606 | if (cmdparams.Length < 4) |
@@ -618,6 +625,7 @@ namespace OpenSim | |||
618 | break; | 625 | break; |
619 | 626 | ||
620 | case "get": | 627 | case "get": |
628 | case "show": | ||
621 | if (cmdparams.Length == 1) | 629 | if (cmdparams.Length == 1) |
622 | { | 630 | { |
623 | foreach (IConfig config in m_config.Source.Configs) | 631 | foreach (IConfig config in m_config.Source.Configs) |
@@ -654,8 +662,8 @@ namespace OpenSim | |||
654 | } | 662 | } |
655 | else | 663 | else |
656 | { | 664 | { |
657 | Notice("Syntax: config get [<section>] [<key>]"); | 665 | Notice("Syntax: config {0} [<section>] [<key>]", firstParam); |
658 | Notice("Example: config get ScriptEngine.DotNetEngine NumberOfScriptThreads"); | 666 | Notice("Example: config {0} ScriptEngine.DotNetEngine NumberOfScriptThreads", firstParam); |
659 | } | 667 | } |
660 | 668 | ||
661 | break; | 669 | break; |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index d78931a..4c8424d 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -29,8 +29,10 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Net.Security; | ||
32 | using System.Text; | 33 | using System.Text; |
33 | using System.Threading; | 34 | using System.Threading; |
35 | using System.Security.Cryptography.X509Certificates; | ||
34 | using Nini.Config; | 36 | using Nini.Config; |
35 | using OpenMetaverse; | 37 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
@@ -100,8 +102,24 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
100 | 102 | ||
101 | public HttpRequestModule() | 103 | public HttpRequestModule() |
102 | { | 104 | { |
105 | ServicePointManager.ServerCertificateValidationCallback +=ValidateServerCertificate; | ||
103 | } | 106 | } |
104 | 107 | ||
108 | public static bool ValidateServerCertificate( | ||
109 | object sender, | ||
110 | X509Certificate certificate, | ||
111 | X509Chain chain, | ||
112 | SslPolicyErrors sslPolicyErrors) | ||
113 | { | ||
114 | HttpWebRequest Request = (HttpWebRequest)sender; | ||
115 | |||
116 | if (Request.Headers.Get("NoVerifyCert") != null) | ||
117 | { | ||
118 | return true; | ||
119 | } | ||
120 | |||
121 | return chain.Build(new X509Certificate2(certificate)); | ||
122 | } | ||
105 | #region IHttpRequestModule Members | 123 | #region IHttpRequestModule Members |
106 | 124 | ||
107 | public UUID MakeHttpRequest(string url, string parameters, string body) | 125 | public UUID MakeHttpRequest(string url, string parameters, string body) |
@@ -141,8 +159,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
141 | break; | 159 | break; |
142 | 160 | ||
143 | case (int)HttpRequestConstants.HTTP_VERIFY_CERT: | 161 | case (int)HttpRequestConstants.HTTP_VERIFY_CERT: |
144 | 162 | htc.HttpVerifyCert = (int.Parse(parms[i + 1]) != 0); | |
145 | // TODO implement me | ||
146 | break; | 163 | break; |
147 | } | 164 | } |
148 | } | 165 | } |
@@ -189,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
189 | * Not sure how important ordering is is here - the next first | 206 | * Not sure how important ordering is is here - the next first |
190 | * one completed in the list is returned, based soley on its list | 207 | * one completed in the list is returned, based soley on its list |
191 | * position, not the order in which the request was started or | 208 | * position, not the order in which the request was started or |
192 | * finsihed. I thought about setting up a queue for this, but | 209 | * finished. I thought about setting up a queue for this, but |
193 | * it will need some refactoring and this works 'enough' right now | 210 | * it will need some refactoring and this works 'enough' right now |
194 | */ | 211 | */ |
195 | 212 | ||
@@ -237,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
237 | 254 | ||
238 | m_scene.RegisterModuleInterface<IHttpRequestModule>(this); | 255 | m_scene.RegisterModuleInterface<IHttpRequestModule>(this); |
239 | 256 | ||
240 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | 257 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); |
241 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | 258 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); |
242 | 259 | ||
243 | m_pendingRequests = new Dictionary<UUID, HttpRequestClass>(); | 260 | m_pendingRequests = new Dictionary<UUID, HttpRequestClass>(); |
244 | } | 261 | } |
@@ -282,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
282 | public string HttpMethod = "GET"; | 299 | public string HttpMethod = "GET"; |
283 | public string HttpMIMEType = "text/plain;charset=utf-8"; | 300 | public string HttpMIMEType = "text/plain;charset=utf-8"; |
284 | public int HttpTimeout; | 301 | public int HttpTimeout; |
285 | // public bool HttpVerifyCert = true; // not implemented | 302 | public bool HttpVerifyCert = true; |
286 | private Thread httpThread; | 303 | private Thread httpThread; |
287 | 304 | ||
288 | // Request info | 305 | // Request info |
@@ -344,6 +361,17 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
344 | Request.Method = HttpMethod; | 361 | Request.Method = HttpMethod; |
345 | Request.ContentType = HttpMIMEType; | 362 | Request.ContentType = HttpMIMEType; |
346 | 363 | ||
364 | if(!HttpVerifyCert) | ||
365 | { | ||
366 | // We could hijack Connection Group Name to identify | ||
367 | // a desired security exception. But at the moment we'll use a dummy header instead. | ||
368 | // Request.ConnectionGroupName = "NoVerify"; | ||
369 | Request.Headers.Add("NoVerifyCert", "true"); | ||
370 | } | ||
371 | // else | ||
372 | // { | ||
373 | // Request.ConnectionGroupName="Verify"; | ||
374 | // } | ||
347 | if (proxyurl != null && proxyurl.Length > 0) | 375 | if (proxyurl != null && proxyurl.Length > 0) |
348 | { | 376 | { |
349 | if (proxyexcepts != null && proxyexcepts.Length > 0) | 377 | if (proxyexcepts != null && proxyexcepts.Length > 0) |
@@ -436,4 +464,4 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
436 | } | 464 | } |
437 | } | 465 | } |
438 | } | 466 | } |
439 | } | 467 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/ModuleLoader.cs b/OpenSim/Region/Framework/ModuleLoader.cs index 23be9c2..14ecd44 100644 --- a/OpenSim/Region/Framework/ModuleLoader.cs +++ b/OpenSim/Region/Framework/ModuleLoader.cs | |||
@@ -223,7 +223,8 @@ namespace OpenSim.Region.Framework | |||
223 | catch (Exception e) | 223 | catch (Exception e) |
224 | { | 224 | { |
225 | m_log.ErrorFormat( | 225 | m_log.ErrorFormat( |
226 | "[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e); | 226 | "[MODULES]: Could not load types for plugin DLL {0}. Exception {1} {2}", |
227 | pluginAssembly.FullName, e.Message, e.StackTrace); | ||
227 | 228 | ||
228 | // justincc: Right now this is fatal to really get the user's attention | 229 | // justincc: Right now this is fatal to really get the user's attention |
229 | throw e; | 230 | throw e; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c16a985..aa28fa0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10289,12 +10289,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10289 | { | 10289 | { |
10290 | UUID rq = UUID.Random(); | 10290 | UUID rq = UUID.Random(); |
10291 | 10291 | ||
10292 | UUID tid = AsyncCommands. | 10292 | AsyncCommands.DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString()); |
10293 | DataserverPlugin.RegisterRequest(m_localID, | ||
10294 | m_itemID, rq.ToString()); | ||
10295 | 10293 | ||
10296 | AsyncCommands. | 10294 | AsyncCommands.DataserverPlugin.DataserverReply(rq.ToString(), Name2Username(llKey2Name(id))); |
10297 | DataserverPlugin.DataserverReply(rq.ToString(), Name2Username(llKey2Name(id))); | ||
10298 | 10295 | ||
10299 | return rq.ToString(); | 10296 | return rq.ToString(); |
10300 | } | 10297 | } |
@@ -10308,12 +10305,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10308 | { | 10305 | { |
10309 | UUID rq = UUID.Random(); | 10306 | UUID rq = UUID.Random(); |
10310 | 10307 | ||
10311 | UUID tid = AsyncCommands. | 10308 | AsyncCommands.DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString()); |
10312 | DataserverPlugin.RegisterRequest(m_localID, | ||
10313 | m_itemID, rq.ToString()); | ||
10314 | 10309 | ||
10315 | AsyncCommands. | 10310 | AsyncCommands.DataserverPlugin.DataserverReply(rq.ToString(), llKey2Name(id)); |
10316 | DataserverPlugin.DataserverReply(rq.ToString(), llKey2Name(id)); | ||
10317 | 10311 | ||
10318 | return rq.ToString(); | 10312 | return rq.ToString(); |
10319 | } | 10313 | } |