From 5dcbbb726a15bc14da76b59577d009c25ad5e4e1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 18:40:13 +0100 Subject: Change the order of actions to address a possible nullref --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index b45291f..e6f7235 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,11 +179,10 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { - if (m_pendingObjects != null) + lock (m_pendingObjects) { - lock (m_pendingObjects) + if (m_pendingObjects != null) { - m_pendingObjects.Clear(); m_pendingObjects = null; } -- cgit v1.1 From 4a0911bdbd3429d88b448bd324d8813cf6023e64 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 19:19:07 +0100 Subject: Guard against locking a nullref to avoid build break --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index e6f7235..b44a010 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,6 +179,9 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { + if (m_pendingObjects == null) + return; + lock (m_pendingObjects) { if (m_pendingObjects != null) -- cgit v1.1 From 4a57288577dd3ec6a99f467b4a2761fe83b0b4b8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 23:23:07 +0100 Subject: Fix an infinite recursion --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d05cfc2..7a175ea 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -208,7 +208,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } foreach (List objlist in deletes.Values) - ret = DeleteToInventory(action, folderID, objlist, remoteClient); + { + foreach (SceneObjectGroup g in objlist) + ret = DeleteToInventory(action, folderID, g, remoteClient); + } return ret; } -- cgit v1.1 From 06d3a529a9ea31de997f187bfa6a646e25b7a1cf Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 17:46:09 +0200 Subject: In case when 1 single byte is requested (yes viewer does this) start of the ranges gets clamped with a wrong value. In case of a texture with 601 byte long texture the viewer request range 0-599 first, then 600- in which case both start and end should be 600. End can also be 0, valid request for the firt byte of the file is 0-0. Thanks to Thickbrick for explaining how HTTP range header works. --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index a3238df..d564ee6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - end = Utils.Clamp(end, 1, texture.Data.Length - 1); - start = Utils.Clamp(start, 0, end - 1); + end = Utils.Clamp(end, 0, texture.Data.Length - 1); + start = Utils.Clamp(start, 0, end); int len = end - start + 1; //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); -- cgit v1.1 From 5e381ec67c1a8d108fced63b76ae44eeb70aa38e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:01:11 +0200 Subject: Return error code instead of the last byte of the file if range is not satisfiable --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index d564ee6..6545be7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -186,7 +186,15 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps // Range request int start, end; if (TryParseRange(range, out start, out end)) - { + { + // Before clamping end make sure we can satisfy it in order to avoid + // sending back the last byte instead of an error status + if (end >= texture.Data.Length) + { + response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; + return; + } + end = Utils.Clamp(end, 0, texture.Data.Length - 1); start = Utils.Clamp(start, 0, end); int len = end - start + 1; -- cgit v1.1 From 3454dfbcb3f76375ad5d98249a3cde27e5e5b250 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 9 Oct 2010 12:07:58 -0400 Subject: weird line endings fix commit --- .../Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 6545be7..38151b1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -186,13 +186,13 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps // Range request int start, end; if (TryParseRange(range, out start, out end)) - { - // Before clamping end make sure we can satisfy it in order to avoid - // sending back the last byte instead of an error status - if (end >= texture.Data.Length) - { - response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; - return; + { + // Before clamping end make sure we can satisfy it in order to avoid + // sending back the last byte instead of an error status + if (end >= texture.Data.Length) + { + response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; + return; } end = Utils.Clamp(end, 0, texture.Data.Length - 1); -- cgit v1.1 From 0dd4071156bc5def8bb8f6bb54051aa6198f1186 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:22:21 +0200 Subject: Fix a typo in previouis commit: start must not pass the end of the file --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 38151b1..97581e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,9 +187,9 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - // Before clamping end make sure we can satisfy it in order to avoid + // Before clamping start make sure we can satisfy it in order to avoid // sending back the last byte instead of an error status - if (end >= texture.Data.Length) + if (start >= texture.Data.Length) { response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; return; -- cgit v1.1 From cf61cf7b323b433adb77517989659278fa4a541e Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 9 Oct 2010 13:50:53 -0400 Subject: * Make line endings consistant in Meshmerizer.cs --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index c97db8c..cf57c0a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing { IConfig start_config = config.Configs["Startup"]; - decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); + decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); try -- cgit v1.1 From f2febb89fc8eee4977d965eeb24bd576cc8fb933 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Oct 2010 22:06:47 +0100 Subject: Change the part for sound playback to be the root part / object UUID instead of the child prim because using the child prim plain doesn't work. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8140d42..39b109b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2694,7 +2694,7 @@ namespace OpenSim.Region.Framework.Scenes public void PreloadSound(string sound) { // UUID ownerID = OwnerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID soundID = UUID.Zero; if (!UUID.TryParse(sound, out soundID)) @@ -3101,7 +3101,7 @@ namespace OpenSim.Region.Framework.Scenes volume = 0; UUID ownerID = _ownerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID parentID = GetRootPartUUID(); UUID soundID = UUID.Zero; Vector3 position = AbsolutePosition; // region local @@ -3138,11 +3138,11 @@ namespace OpenSim.Region.Framework.Scenes else soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); ParentGroup.PlaySoundMasterPrim = this; - ownerID = this._ownerID; - objectID = this.UUID; - parentID = this.GetRootPartUUID(); - position = this.AbsolutePosition; // region local - regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle; + ownerID = _ownerID; + objectID = ParentGroup.RootPart.UUID; + parentID = GetRootPartUUID(); + position = AbsolutePosition; // region local + regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; if (triggered) soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); else @@ -3150,7 +3150,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) { ownerID = prim._ownerID; - objectID = prim.UUID; + objectID = prim.ParentGroup.RootPart.UUID; parentID = prim.GetRootPartUUID(); position = prim.AbsolutePosition; // region local regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; -- cgit v1.1