From 57ba9ef5ad05d2479a5bfb188d8a2827e63f0f0f Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 13 Jan 2012 11:35:44 -0500 Subject: Update RegionReadyModule Fix triggering of alerts when rezzing first script to an empty region, add login disable when loading oars. --- OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 0707cbe..a945fc2 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -98,6 +98,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; }); options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; }); + + // Send a message to the region ready module + IRegionReadyModule rready = m_scene.RequestModuleInterface(); + + if (rready != null) + { + rready.OarLoadingAlert("load"); + } List mainParams = options.Parse(cmdparams); @@ -125,7 +133,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Dictionary options = new Dictionary(); OptionSet ops = new OptionSet(); - + // legacy argument [obsolete] ops.Add("p|profile=", delegate(string v) { Console.WriteLine("\n WARNING: -profile option is obsolete and it will not work. Use -home instead.\n"); }); // preferred -- cgit v1.1 From 02d6b033d0858ed955e711f4a3958d41c464f977 Mon Sep 17 00:00:00 2001 From: Bo Iwu Date: Fri, 13 Jan 2012 22:41:38 +0100 Subject: Fix improper code formatting introduced in 6214e6a217cf Signed-off-by: BlueWall --- .../UserManagement/UserManagementModule.cs | 64 ++++++++++++++-------- 1 file changed, 40 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index bbdf92a..b4f6b5a 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -335,54 +335,70 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement { UserData oldUser; //lock the whole block - prevent concurrent update - lock (m_UserCache) { + lock (m_UserCache) + { m_UserCache.TryGetValue (id, out oldUser); - if (oldUser != null) { - if (creatorData == null || creatorData == String.Empty) { + if (oldUser != null) + { + if (creatorData == null || creatorData == String.Empty) + { //ignore updates without creator data return; } //try update unknown users //and creator's home URL's - if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL))) { + if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL))) + { m_UserCache.Remove (id); -// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData,oldUser.HomeURL); - } else { +// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData,oldUser.HomeURL); + } + else + { //we have already a valid user within the cache return; } } -// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); - - UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount (m_Scenes[0].RegionInfo.ScopeID, id); - - if (account != null) { +// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); + + UserAccount account = m_Scenes [0].UserAccountService.GetUserAccount (m_Scenes [0].RegionInfo.ScopeID, id); + + if (account != null) + { AddUser (id, account.FirstName, account.LastName); - } else { + } + else + { UserData user = new UserData (); user.Id = id; - - if (creatorData != null && creatorData != string.Empty) { + + if (creatorData != null && creatorData != string.Empty) + { //creatorData = ; - + string[] parts = creatorData.Split (';'); - if (parts.Length >= 1) { - user.HomeURL = parts[0]; - try { - Uri uri = new Uri (parts[0]); + if (parts.Length >= 1) + { + user.HomeURL = parts [0]; + try + { + Uri uri = new Uri (parts [0]); user.LastName = "@" + uri.Authority; - } catch (UriFormatException) { - m_log.DebugFormat ("[SCENE]: Unable to parse Uri {0}", parts[0]); + } + catch (UriFormatException) + { + m_log.DebugFormat ("[SCENE]: Unable to parse Uri {0}", parts [0]); user.LastName = "@unknown"; } } if (parts.Length >= 2) - user.FirstName = parts[1].Replace (' ', '.'); - } else { + user.FirstName = parts [1].Replace (' ', '.'); + } + else + { user.FirstName = "Unknown"; user.LastName = "User"; } - + AddUserInternal (user); } } -- cgit v1.1 From b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Jan 2012 00:23:11 +0000 Subject: Register the UrlModule for script engine events OnScriptRemoved and OnObjectRemoved just once in the UrlModule itself, rather than repeatedly for every script. Doing this in every script is unnecessary since the event trigger is parameterized by the item id. All that would happen is 2000 scripts would trigger 1999 unnecessary calls, and a large number of initialized scripts may eventually trigger a StackOverflowException. Registration moved to UrlModule so that the handler is registered for all script engine implementations. This required moving the OnScriptRemoved and OnObjectRemoved events (only used by UrlModule in core) from IScriptEngine to IScriptModule to avoid circular references. --- OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 67d99e0..93e75b3 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -131,6 +131,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RegionLoaded(Scene scene) { + IScriptModule[] scriptModules = scene.RequestModuleInterfaces(); + foreach (IScriptModule scriptModule in scriptModules) + { + scriptModule.OnScriptRemoved += ScriptRemoved; + scriptModule.OnObjectRemoved += ObjectRemoved; + } } public void RemoveRegion(Scene scene) @@ -160,7 +166,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp urlData.url = url; urlData.urlcode = urlcode; urlData.requests = new Dictionary(); - m_UrlMap[url] = urlData; @@ -276,6 +281,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void ScriptRemoved(UUID itemID) { +// m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID); + lock (m_UrlMap) { List removeURLs = new List(); -- cgit v1.1 From ec299bfa878498713e4538f825fd3a2ca92cd125 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 14 Jan 2012 05:28:57 +0100 Subject: Allow SmtpClients and other SSL users to work with our cert handler installed --- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 8fb5d75..d328eb3 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Net; +using System.Net.Mail; using System.Net.Security; using System.Text; using System.Threading; @@ -111,21 +112,36 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest X509Chain chain, SslPolicyErrors sslPolicyErrors) { - HttpWebRequest Request = (HttpWebRequest)sender; - - if (Request.Headers.Get("NoVerifyCert") != null) + // If this is a web request we need to check the headers first + // We may want to ignore SSL + if (sender is HttpWebRequest) { + HttpWebRequest Request = (HttpWebRequest)sender; + ServicePoint sp = Request.ServicePoint; + + // We don't case about encryption, get out of here + if (Request.Headers.Get("NoVerifyCert") != null) + { + return true; + } + + // If there was an upstream cert verification error, bail + if ((((int)sslPolicyErrors) & ~4) != 0) + return false; + + // Check for policy and execute it if defined + if (ServicePointManager.CertificatePolicy != null) + { + return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0); + } + return true; } - + + // If it's not HTTP, trust .NET to check it if ((((int)sslPolicyErrors) & ~4) != 0) return false; - if (ServicePointManager.CertificatePolicy != null) - { - ServicePoint sp = Request.ServicePoint; - return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0); - } return true; } #region IHttpRequestModule Members -- cgit v1.1