From 06d3a529a9ea31de997f187bfa6a646e25b7a1cf Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 17:46:09 +0200 Subject: [PATCH 1/7] 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(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index a3238dff9f..d564ee6a10 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); From 5e381ec67c1a8d108fced63b76ae44eeb70aa38e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:01:11 +0200 Subject: [PATCH 2/7] Return error code instead of the last byte of the file if range is not satisfiable --- .../CoreModules/Avatar/Assets/GetTextureModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index d564ee6a10..6545be769d 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; From 3454dfbcb3f76375ad5d98249a3cde27e5e5b250 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sat, 9 Oct 2010 12:07:58 -0400 Subject: [PATCH 3/7] weird line endings fix commit --- .../CoreModules/Avatar/Assets/GetTextureModule.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 6545be769d..38151b1bb1 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); From 78f6fe0b311fc43cbb98cebb385e20baced14a38 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 9 Oct 2010 09:09:16 -0700 Subject: [PATCH 4/7] Added missing sections to StandaloneHypergrid.ini --- bin/config-include/StandaloneHypergrid.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 317af4ba1d..f164d33e1e 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -31,6 +31,12 @@ AuthenticationServiceInConnector = true SimulationServiceInConnector = true +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" + [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" From 0dd4071156bc5def8bb8f6bb54051aa6198f1186 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 18:22:21 +0200 Subject: [PATCH 5/7] 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(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 38151b1bb1..97581e5206 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; From cf61cf7b323b433adb77517989659278fa4a541e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sat, 9 Oct 2010 13:50:53 -0400 Subject: [PATCH 6/7] * Make line endings consistant in Meshmerizer.cs --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index c97db8ca0f..cf57c0a120 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 From f2febb89fc8eee4977d965eeb24bd576cc8fb933 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Oct 2010 22:06:47 +0100 Subject: [PATCH 7/7] 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. --- .../Region/Framework/Scenes/SceneObjectPart.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8140d42bce..39b109ba38 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;