aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-09-13 23:28:36 +0100
committerMelanie2010-09-13 23:28:36 +0100
commit0de2f0567d2e1a92bf95bc49eeaa8ed0743ddd36 (patch)
treeb697e3499f63be96b408ef5c3569c6b56b29e17e /OpenSim/Region
parentChange the help message to point to copying OpenSimDefaults.ini.example. (diff)
parentAdding missing ConnectionString lines to [DatabaseService] sections for SQLit... (diff)
downloadopensim-SC-0de2f0567d2e1a92bf95bc49eeaa8ed0743ddd36.zip
opensim-SC-0de2f0567d2e1a92bf95bc49eeaa8ed0743ddd36.tar.gz
opensim-SC-0de2f0567d2e1a92bf95bc49eeaa8ed0743ddd36.tar.bz2
opensim-SC-0de2f0567d2e1a92bf95bc49eeaa8ed0743ddd36.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
index 8aa87fd..a3238df 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
187 int start, end; 187 int start, end;
188 if (TryParseRange(range, out start, out end)) 188 if (TryParseRange(range, out start, out end))
189 { 189 {
190 end = Utils.Clamp(end, 1, texture.Data.Length); 190 end = Utils.Clamp(end, 1, texture.Data.Length - 1);
191 start = Utils.Clamp(start, 0, end - 1); 191 start = Utils.Clamp(start, 0, end - 1);
192 int len = end - start + 1;
192 193
193 //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); 194 //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
194 195
195 if (end - start < texture.Data.Length) 196 if (len < texture.Data.Length)
196 response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; 197 response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
197 198
198 response.ContentLength = end - start; 199 response.ContentLength = len;
199 response.ContentType = texture.Metadata.ContentType; 200 response.ContentType = texture.Metadata.ContentType;
201 response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
200 202
201 response.Body.Write(texture.Data, start, end - start); 203 response.Body.Write(texture.Data, start, len);
202 } 204 }
203 else 205 else
204 { 206 {