Merge branch 'master' into queuetest

This commit is contained in:
Mic Bowman
2011-04-12 12:38:47 -07:00
8 changed files with 158 additions and 74 deletions

View File

@@ -39,6 +39,8 @@ namespace OpenSim.Data.MySQL
{
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, FieldInfo> m_Fields =
new Dictionary<string, FieldInfo>();
@@ -217,7 +219,6 @@ namespace OpenSim.Data.MySQL
{
using (MySqlCommand cmd = new MySqlCommand())
{
string query = "";
List<String> names = new List<String>();
List<String> values = new List<String>();
@@ -226,6 +227,16 @@ namespace OpenSim.Data.MySQL
{
names.Add(fi.Name);
values.Add("?" + fi.Name);
// Temporarily return more information about what field is unexpectedly null for
// http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the
// InventoryTransferModule or we may be required to substitute a DBNull here.
if (fi.GetValue(row) == null)
throw new NullReferenceException(
string.Format(
"[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null",
fi.Name, row));
cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
}
@@ -268,4 +279,4 @@ namespace OpenSim.Data.MySQL
}
}
}
}
}

View File

@@ -341,10 +341,15 @@ namespace OpenSim
m_console.Commands.AddCommand("region", false, "config get",
"config get [<section>] [<key>]",
"Show a config option",
"Synonym for config show",
HandleConfig);
m_console.Commands.AddCommand("region", false, "config show",
"config show [<section>] [<key>]",
"Show config information",
"If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
+ "If a section is given but not a field, then all fields in that section are printed.",
HandleConfig);
HandleConfig);
m_console.Commands.AddCommand("region", false, "config save",
"config save <path>",
@@ -593,7 +598,9 @@ namespace OpenSim
if (cmdparams.Length > 0)
{
switch (cmdparams[0].ToLower())
string firstParam = cmdparams[0].ToLower();
switch (firstParam)
{
case "set":
if (cmdparams.Length < 4)
@@ -618,6 +625,7 @@ namespace OpenSim
break;
case "get":
case "show":
if (cmdparams.Length == 1)
{
foreach (IConfig config in m_config.Source.Configs)
@@ -654,8 +662,8 @@ namespace OpenSim
}
else
{
Notice("Syntax: config get [<section>] [<key>]");
Notice("Example: config get ScriptEngine.DotNetEngine NumberOfScriptThreads");
Notice("Syntax: config {0} [<section>] [<key>]", firstParam);
Notice("Example: config {0} ScriptEngine.DotNetEngine NumberOfScriptThreads", firstParam);
}
break;

View File

@@ -29,8 +29,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Text;
using System.Threading;
using System.Security.Cryptography.X509Certificates;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
@@ -100,8 +102,24 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
public HttpRequestModule()
{
ServicePointManager.ServerCertificateValidationCallback +=ValidateServerCertificate;
}
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
HttpWebRequest Request = (HttpWebRequest)sender;
if (Request.Headers.Get("NoVerifyCert") != null)
{
return true;
}
return chain.Build(new X509Certificate2(certificate));
}
#region IHttpRequestModule Members
public UUID MakeHttpRequest(string url, string parameters, string body)
@@ -141,8 +159,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
break;
case (int)HttpRequestConstants.HTTP_VERIFY_CERT:
// TODO implement me
htc.HttpVerifyCert = (int.Parse(parms[i + 1]) != 0);
break;
}
}
@@ -189,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
* Not sure how important ordering is is here - the next first
* one completed in the list is returned, based soley on its list
* position, not the order in which the request was started or
* finsihed. I thought about setting up a queue for this, but
* finished. I thought about setting up a queue for this, but
* it will need some refactoring and this works 'enough' right now
*/
@@ -237,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
m_scene.RegisterModuleInterface<IHttpRequestModule>(this);
m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
m_pendingRequests = new Dictionary<UUID, HttpRequestClass>();
}
@@ -282,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
public string HttpMethod = "GET";
public string HttpMIMEType = "text/plain;charset=utf-8";
public int HttpTimeout;
// public bool HttpVerifyCert = true; // not implemented
public bool HttpVerifyCert = true;
private Thread httpThread;
// Request info
@@ -344,6 +361,17 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
Request.Method = HttpMethod;
Request.ContentType = HttpMIMEType;
if(!HttpVerifyCert)
{
// We could hijack Connection Group Name to identify
// a desired security exception. But at the moment we'll use a dummy header instead.
// Request.ConnectionGroupName = "NoVerify";
Request.Headers.Add("NoVerifyCert", "true");
}
// else
// {
// Request.ConnectionGroupName="Verify";
// }
if (proxyurl != null && proxyurl.Length > 0)
{
if (proxyexcepts != null && proxyexcepts.Length > 0)
@@ -436,4 +464,4 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
}
}
}
}
}

View File

@@ -223,7 +223,8 @@ namespace OpenSim.Region.Framework
catch (Exception e)
{
m_log.ErrorFormat(
"[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e);
"[MODULES]: Could not load types for plugin DLL {0}. Exception {1} {2}",
pluginAssembly.FullName, e.Message, e.StackTrace);
// justincc: Right now this is fatal to really get the user's attention
throw e;

View File

@@ -10289,12 +10289,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
UUID rq = UUID.Random();
UUID tid = AsyncCommands.
DataserverPlugin.RegisterRequest(m_localID,
m_itemID, rq.ToString());
AsyncCommands.DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString());
AsyncCommands.
DataserverPlugin.DataserverReply(rq.ToString(), Name2Username(llKey2Name(id)));
AsyncCommands.DataserverPlugin.DataserverReply(rq.ToString(), Name2Username(llKey2Name(id)));
return rq.ToString();
}
@@ -10308,12 +10305,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
UUID rq = UUID.Random();
UUID tid = AsyncCommands.
DataserverPlugin.RegisterRequest(m_localID,
m_itemID, rq.ToString());
AsyncCommands.DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString());
AsyncCommands.
DataserverPlugin.DataserverReply(rq.ToString(), llKey2Name(id));
AsyncCommands.DataserverPlugin.DataserverReply(rq.ToString(), llKey2Name(id));
return rq.ToString();
}

View File

@@ -169,7 +169,7 @@ namespace OpenSim.Services.Interfaces
/// Get an item, given by its UUID
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
/// <returns>null if no item was found, otherwise the found item</returns>
InventoryItemBase GetItem(InventoryItemBase item);
/// <summary>