From 5ef2da39d81c038c087b493330497856ed18325d Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 13 Sep 2010 11:23:45 -0700 Subject: [PATCH 1/2] * Fixing length calculations for HTTP texture downloads (the end byte is inclusive in Range: headers) --- .../CoreModules/Avatar/Assets/GetTextureModule.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 8aa87fddee..a3238dff9f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,18 +187,20 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - end = Utils.Clamp(end, 1, texture.Data.Length); + end = Utils.Clamp(end, 1, texture.Data.Length - 1); start = Utils.Clamp(start, 0, end - 1); + int len = end - start + 1; //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); - if (end - start < texture.Data.Length) + if (len < texture.Data.Length) response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; - response.ContentLength = end - start; + response.ContentLength = len; response.ContentType = texture.Metadata.ContentType; + response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length)); - response.Body.Write(texture.Data, start, end - start); + response.Body.Write(texture.Data, start, len); } else { From 2ed276eb4759e61337058a0fc138f243b355ab13 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 13 Sep 2010 11:39:58 -0700 Subject: [PATCH 2/2] Adding missing ConnectionString lines to [DatabaseService] sections for SQLite configs --- bin/config-include/storage/SQLiteLegacyStandalone.ini | 1 + bin/config-include/storage/SQLiteStandalone.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/config-include/storage/SQLiteLegacyStandalone.ini b/bin/config-include/storage/SQLiteLegacyStandalone.ini index 1d4dd29d60..facbbd6bcd 100644 --- a/bin/config-include/storage/SQLiteLegacyStandalone.ini +++ b/bin/config-include/storage/SQLiteLegacyStandalone.ini @@ -2,6 +2,7 @@ [DatabaseService] StorageProvider = "OpenSim.Data.SQLiteLegacy.dll" + ConnectionString = "URI=file:OpenSim.db,version=3,UseUTF16Encoding=True" [AvatarService] ConnectionString = "URI=file:avatars.db,version=3" diff --git a/bin/config-include/storage/SQLiteStandalone.ini b/bin/config-include/storage/SQLiteStandalone.ini index fe814d7022..10e6991954 100644 --- a/bin/config-include/storage/SQLiteStandalone.ini +++ b/bin/config-include/storage/SQLiteStandalone.ini @@ -2,6 +2,7 @@ [DatabaseService] StorageProvider = "OpenSim.Data.SQLite.dll" + ConnectionString = "URI=file:OpenSim.db,version=3,UseUTF16Encoding=True" [InventoryService] ;ConnectionString = "URI=file:inventory.db,version=3"