diff options
Diffstat (limited to 'OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs')
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs index 72769c2..506f9d2 100644 --- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs | |||
@@ -157,25 +157,14 @@ namespace OpenSim.Capabilities.Handlers | |||
157 | int len = end - start + 1; | 157 | int len = end - start + 1; |
158 | 158 | ||
159 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 159 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
160 | 160 | responsedata["int_response_code"] = | |
161 | if (start == 0 && len == mesh.Data.Length) // well redudante maybe | 161 | (int)System.Net.HttpStatusCode.PartialContent; |
162 | { | 162 | headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, mesh.Data.Length); |
163 | responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK; | 163 | |
164 | responsedata["bin_response_data"] = mesh.Data; | 164 | byte[] d = new byte[len]; |
165 | responsedata["int_bytes"] = mesh.Data.Length; | 165 | Array.Copy(mesh.Data, start, d, 0, len); |
166 | } | 166 | responsedata["bin_response_data"] = d; |
167 | else | 167 | responsedata["int_bytes"] = len; |
168 | { | ||
169 | responsedata["int_response_code"] = | ||
170 | (int)System.Net.HttpStatusCode.PartialContent; | ||
171 | headers["Content-Range"] = String.Format("bytes {0}-{1}/{2}", start, end, | ||
172 | mesh.Data.Length); | ||
173 | |||
174 | byte[] d = new byte[len]; | ||
175 | Array.Copy(mesh.Data, start, d, 0, len); | ||
176 | responsedata["bin_response_data"] = d; | ||
177 | responsedata["int_bytes"] = len; | ||
178 | } | ||
179 | } | 168 | } |
180 | } | 169 | } |
181 | else | 170 | else |
@@ -213,6 +202,7 @@ namespace OpenSim.Capabilities.Handlers | |||
213 | 202 | ||
214 | return responsedata; | 203 | return responsedata; |
215 | } | 204 | } |
205 | |||
216 | private bool TryParseRange(string header, out int start, out int end) | 206 | private bool TryParseRange(string header, out int start, out int end) |
217 | { | 207 | { |
218 | if (header.StartsWith("bytes=")) | 208 | if (header.StartsWith("bytes=")) |