From 6ea394467d6eed0e11958b19c17924b7bb3e557f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Nov 2018 15:09:49 +0000 Subject: if viewer asks for range reply in same format even if its full data --- .../Handlers/GetTexture/GetTextureHandler.cs | 23 ++++++---------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'OpenSim/Capabilities/Handlers/GetTexture') 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 // m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); response["content-type"] = texture.Metadata.ContentType; + response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent; + headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length); - if (start == 0 && len == texture.Data.Length) // well redudante maybe - { - response["int_response_code"] = (int)System.Net.HttpStatusCode.OK; - response["bin_response_data"] = texture.Data; - response["int_bytes"] = texture.Data.Length; - } - else - { - response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent; - headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length); - - byte[] d = new byte[len]; - Array.Copy(texture.Data, start, d, 0, len); - response["bin_response_data"] = d; - response["int_bytes"] = len; - } -// response.Body.Write(texture.Data, start, len); + byte[] d = new byte[len]; + Array.Copy(texture.Data, start, d, 0, len); + response["bin_response_data"] = d; + response["int_bytes"] = len; } } else -- cgit v1.1