From 06d3a529a9ea31de997f187bfa6a646e25b7a1cf Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 9 Oct 2010 17:46:09 +0200 Subject: [PATCH 1/6] 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/6] 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/6] 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/6] 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/6] 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/6] * 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