From 6848465ae24f2069c2cc3e67ff317ad2d085f5cb Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 24 Jun 2010 13:43:38 -0700 Subject: [PATCH 1/7] * SimianAssetServiceConnector Delete() was expecting the wrong type of response, reporting false errors * Fixed a typo in a WebUtil error message --- OpenSim/Framework/WebUtil.cs | 2 +- .../SimianGrid/SimianAssetServiceConnector.cs | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 94862a6372..e20866eaa3 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -114,7 +114,7 @@ namespace OpenSim.Framework } catch (Exception ex) { - m_log.Warn("GET from URL " + url + " failed: " + ex.Message); + m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message); errorMessage = ex.Message; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 3fdee9c8b4..34bb8b38c8 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid /// public bool Delete(string id) { + string errorMessage = String.Empty; + string url = m_serverUrl + id; + if (m_cache != null) m_cache.Expire(id); - string url = m_serverUrl + id; + try + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); + request.Method = "DELETE"; + + using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + { + if (response.StatusCode != HttpStatusCode.NoContent) + { + m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " + + response.StatusCode + " (" + response.StatusDescription + ")"); + } + } - OSDMap response = WebUtil.ServiceRequest(url, "DELETE"); - if (response["Success"].AsBoolean()) return true; - else - m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service"); - - return false; + } + catch (Exception ex) + { + m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message); + return false; + } } #endregion IAssetService From 977eccf12728c364170f911a660f22de7e8d92a1 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 25 Jun 2010 05:15:26 -0700 Subject: [PATCH 2/7] This file wants to be committed. Line endings mess up. --- .../Shared/Api/Implementation/LSL_Api.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 86d0c30f93..1feb153fb4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6516,15 +6516,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (cut.y > 1f) { cut.y = 1f; - } - if (cut.y - cut.x < 0.05f) - { - cut.x = cut.y - 0.05f; - if (cut.x < 0.0f) - { - cut.x = 0.0f; - cut.y = 0.05f; - } + } + if (cut.y - cut.x < 0.05f) + { + cut.x = cut.y - 0.05f; + if (cut.x < 0.0f) + { + cut.x = 0.0f; + cut.y = 0.05f; + } } shapeBlock.ProfileBegin = (ushort)(50000 * cut.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y)); @@ -6722,11 +6722,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (profilecut.y - profilecut.x < 0.05f) { - profilecut.x = profilecut.y - 0.05f; - if (profilecut.x < 0.0f) - { - profilecut.x = 0.0f; - profilecut.y = 0.05f; + profilecut.x = profilecut.y - 0.05f; + if (profilecut.x < 0.0f) + { + profilecut.x = 0.0f; + profilecut.y = 0.05f; } } shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x); From 2c4df19805f9b8d819071c55302450cca1febbc1 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jun 2010 18:29:02 +0100 Subject: [PATCH 3/7] minor: Move log information about SYSTEMIP to the place where it's resolved --- OpenSim/Framework/RegionInfo.cs | 20 +++++++++++++------- OpenSim/Region/Application/OpenSim.cs | 4 +--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ad988165eb..afc4060044 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -29,14 +29,15 @@ using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; +using System.Reflection; using System.Xml; using System.IO; +using log4net; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework.Console; - namespace OpenSim.Framework { public class RegionLightShareData : ICloneable @@ -96,10 +97,9 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo - { - // private static readonly log4net.ILog m_log - // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - + { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) /// @@ -327,8 +327,7 @@ namespace OpenSim.Framework public class RegionInfo { - // private static readonly log4net.ILog m_log - // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public bool commFailTF = false; public ConfigurationMember configMember; @@ -772,9 +771,16 @@ namespace OpenSim.Framework } if (externalName == "SYSTEMIP") + { m_externalHostName = Util.GetLocalHost().ToString(); + m_log.InfoFormat( + "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", + m_externalHostName, name); + } else + { m_externalHostName = externalName; + } m_regionType = config.GetString("RegionType", String.Empty); diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index a09b903bfc..501d47f6d1 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -192,9 +192,7 @@ namespace OpenSim // Hook up to the watchdog timer Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; - PrintFileToConsole("startuplogo.txt"); - - m_log.InfoFormat("[NETWORK]: Using {0} as SYSTEMIP", Util.GetLocalHost().ToString()); + PrintFileToConsole("startuplogo.txt"); // For now, start at the 'root' level by default if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it From 52b711af824eff047f8e65139cf7bdfb150f270f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jun 2010 18:55:20 +0100 Subject: [PATCH 4/7] stop KeyNotFoundException() being thrown in RemoveScenePresence if the agent isn't present in the presence dictionary the code to do this was there but was being circumvented by newmap[agentID] before the check actually took place --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 673674dc24..240c688ff6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -599,7 +599,7 @@ namespace OpenSim.Region.Framework.Scenes if (!Entities.Remove(agentID)) { m_log.WarnFormat( - "[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", + "[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", agentID); } @@ -607,12 +607,13 @@ namespace OpenSim.Region.Framework.Scenes { Dictionary newmap = new Dictionary(m_scenePresenceMap); List newlist = new List(m_scenePresenceArray); - - // Remember the old presene reference from the dictionary - ScenePresence oldref = newmap[agentID]; + // Remove the presence reference from the dictionary - if (newmap.Remove(agentID)) + if (newmap.ContainsKey(agentID)) { + ScenePresence oldref = newmap[agentID]; + newmap.Remove(agentID); + // Find the index in the list where the old ref was stored and remove the reference newlist.RemoveAt(newlist.IndexOf(oldref)); // Swap out the dictionary and list with new references @@ -621,7 +622,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); + m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); } } } From c09451a034babe6de7a2ffec44852a19946ec76d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jun 2010 19:11:22 +0100 Subject: [PATCH 5/7] Report http server onRequest() exception properly. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index a6e00c2251..8c9ed652e8 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e); + m_log.Error("[BASE HTTP SERVER]: OnRequest() failed with ", e); } } From 8629ba80bfb5e9e038a3d25054e0b03a727c6e81 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jun 2010 20:51:21 +0100 Subject: [PATCH 6/7] Revert "Report http server onRequest() exception properly." This reverts commit c09451a034babe6de7a2ffec44852a19946ec76d. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 8c9ed652e8..a6e00c2251 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.Error("[BASE HTTP SERVER]: OnRequest() failed with ", e); + m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e); } } From c7e7cb04a3b8612c660b4fa308f77795d62f629e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jun 2010 20:57:38 +0100 Subject: [PATCH 7/7] fix web request exception reporting properly this time --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index a6e00c2251..8123f2fed7 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); } }