diff options
author | UbitUmarov | 2018-11-06 15:09:49 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-06 15:09:49 +0000 |
commit | 6ea394467d6eed0e11958b19c17924b7bb3e557f (patch) | |
tree | c2ce956c3364321e4ba7108d87c3c9f4f3d1a266 /OpenSim/Capabilities/Handlers/GetTexture | |
parent | fix typo (diff) | |
download | opensim-SC-6ea394467d6eed0e11958b19c17924b7bb3e557f.zip opensim-SC-6ea394467d6eed0e11958b19c17924b7bb3e557f.tar.gz opensim-SC-6ea394467d6eed0e11958b19c17924b7bb3e557f.tar.bz2 opensim-SC-6ea394467d6eed0e11958b19c17924b7bb3e557f.tar.xz |
if viewer asks for range reply in same format even if its full data
Diffstat (limited to 'OpenSim/Capabilities/Handlers/GetTexture')
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 2499ce4..57ec2f5 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -249,24 +249,13 @@ namespace OpenSim.Capabilities.Handlers | |||
249 | // m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 249 | // m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
250 | 250 | ||
251 | response["content-type"] = texture.Metadata.ContentType; | 251 | response["content-type"] = texture.Metadata.ContentType; |
252 | response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent; | ||
253 | headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length); | ||
252 | 254 | ||
253 | if (start == 0 && len == texture.Data.Length) // well redudante maybe | 255 | byte[] d = new byte[len]; |
254 | { | 256 | Array.Copy(texture.Data, start, d, 0, len); |
255 | response["int_response_code"] = (int)System.Net.HttpStatusCode.OK; | 257 | response["bin_response_data"] = d; |
256 | response["bin_response_data"] = texture.Data; | 258 | response["int_bytes"] = len; |
257 | response["int_bytes"] = texture.Data.Length; | ||
258 | } | ||
259 | else | ||
260 | { | ||
261 | response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent; | ||
262 | headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length); | ||
263 | |||
264 | byte[] d = new byte[len]; | ||
265 | Array.Copy(texture.Data, start, d, 0, len); | ||
266 | response["bin_response_data"] = d; | ||
267 | response["int_bytes"] = len; | ||
268 | } | ||
269 | // response.Body.Write(texture.Data, start, len); | ||
270 | } | 259 | } |
271 | } | 260 | } |
272 | else | 261 | else |