Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork

avinationmerge
ubit 2012-09-26 22:04:27 +02:00
commit 810e24af49
2 changed files with 17 additions and 11 deletions

View File

@ -217,17 +217,22 @@ namespace OpenSim.Capabilities.Handlers
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
// Always return PartialContent, even if the range covered the entire data length
// We were accidentally sending back 404 before in this situation
// https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the
// entire range is requested, and viewer 3.2.2 (and very probably earlier) seems fine with this.
response["int_response_code"] = (int)System.Net.HttpStatusCode.PartialContent;
response["content-type"] = texture.Metadata.ContentType; response["content-type"] = texture.Metadata.ContentType;
headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length);
byte[] d = new byte[len]; if (start == 0 && len == texture.Data.Length) // well redudante maybe
Array.Copy(texture.Data, start, d, 0, len); {
response["bin_response_data"] = d; response["int_response_code"] = (int)System.Net.HttpStatusCode.OK;
response["bin_response_data"] = texture.Data;
}
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.Body.Write(texture.Data, start, len); // response.Body.Write(texture.Data, start, len);
} }
} }

View File

@ -150,7 +150,8 @@ namespace OpenSim.Framework
Type == (sbyte)AssetType.SnapshotFolder || Type == (sbyte)AssetType.SnapshotFolder ||
Type == (sbyte)AssetType.TrashFolder || Type == (sbyte)AssetType.TrashFolder ||
Type == (sbyte)AssetType.ImageJPEG || Type == (sbyte)AssetType.ImageJPEG ||
Type == (sbyte) AssetType.ImageTGA || Type == (sbyte)AssetType.ImageTGA ||
Type == (sbyte)AssetType.Mesh ||
Type == (sbyte) AssetType.LSLBytecode); Type == (sbyte) AssetType.LSLBytecode);
} }
} }