aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Capabilities')
-rw-r--r--OpenSim/Capabilities/Caps.cs13
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs35
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs2
-rw-r--r--OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs4
-rw-r--r--OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs2
-rw-r--r--OpenSim/Capabilities/Properties/AssemblyInfo.cs2
6 files changed, 52 insertions, 6 deletions
diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs
index bc6f6f9..241fef3 100644
--- a/OpenSim/Capabilities/Caps.cs
+++ b/OpenSim/Capabilities/Caps.cs
@@ -30,6 +30,7 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Threading;
33using log4net; 34using log4net;
34using Nini.Config; 35using Nini.Config;
35using OpenMetaverse; 36using OpenMetaverse;
@@ -68,6 +69,7 @@ namespace OpenSim.Framework.Capabilities
68 private IHttpServer m_httpListener; 69 private IHttpServer m_httpListener;
69 private UUID m_agentID; 70 private UUID m_agentID;
70 private string m_regionName; 71 private string m_regionName;
72 private ManualResetEvent m_capsActive = new ManualResetEvent(false);
71 73
72 public UUID AgentID 74 public UUID AgentID
73 { 75 {
@@ -171,5 +173,16 @@ namespace OpenSim.Framework.Capabilities
171 } 173 }
172 } 174 }
173 } 175 }
176
177 public void Activate()
178 {
179 m_capsActive.Set();
180 }
181
182 public bool WaitForActivation()
183 {
184 // Wait for 30s. If that elapses, return false and run without caps
185 return m_capsActive.WaitOne(30000);
186 }
174 } 187 }
175} 188}
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 68686c5..aa6203b 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -240,6 +240,11 @@ namespace OpenSim.Capabilities.Handlers
240 } 240 }
241 else 241 else
242 { 242 {
243 // Handle the case where no second range value was given. This is equivalent to requesting
244 // the rest of the entity.
245 if (end == -1)
246 end = int.MaxValue;
247
243 end = Utils.Clamp(end, 0, texture.Data.Length - 1); 248 end = Utils.Clamp(end, 0, texture.Data.Length - 1);
244 start = Utils.Clamp(start, 0, end); 249 start = Utils.Clamp(start, 0, end);
245 int len = end - start + 1; 250 int len = end - start + 1;
@@ -298,15 +303,43 @@ namespace OpenSim.Capabilities.Handlers
298// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length); 303// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
299 } 304 }
300 305
306 /// <summary>
307 /// Parse a range header.
308 /// </summary>
309 /// <remarks>
310 /// As per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html,
311 /// this obeys range headers with two values (e.g. 533-4165) and no second value (e.g. 533-).
312 /// Where there is no value, -1 is returned.
313 /// FIXME: Need to cover the case where only a second value is specified (e.g. -4165), probably by returning -1
314 /// for start.</remarks>
315 /// <returns></returns>
316 /// <param name='header'></param>
317 /// <param name='start'>Start of the range. Undefined if this was not a number.</param>
318 /// <param name='end'>End of the range. Will be -1 if no end specified. Undefined if there was a raw string but this was not a number.</param>
301 private bool TryParseRange(string header, out int start, out int end) 319 private bool TryParseRange(string header, out int start, out int end)
302 { 320 {
321 start = end = 0;
322
303 if (header.StartsWith("bytes=")) 323 if (header.StartsWith("bytes="))
304 { 324 {
305 string[] rangeValues = header.Substring(6).Split('-'); 325 string[] rangeValues = header.Substring(6).Split('-');
326
306 if (rangeValues.Length == 2) 327 if (rangeValues.Length == 2)
307 { 328 {
308 if (Int32.TryParse(rangeValues[0], out start) && Int32.TryParse(rangeValues[1], out end)) 329 if (!Int32.TryParse(rangeValues[0], out start))
330 return false;
331
332 string rawEnd = rangeValues[1];
333
334 if (rawEnd == "")
335 {
336 end = -1;
337 return true;
338 }
339 else if (Int32.TryParse(rawEnd, out end))
340 {
309 return true; 341 return true;
342 }
310 } 343 }
311 } 344 }
312 345
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index b6ae41b..217a265 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -43,7 +43,7 @@ using OpenSim.Tests.Common.Mock;
43namespace OpenSim.Capabilities.Handlers.GetTexture.Tests 43namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
44{ 44{
45 [TestFixture] 45 [TestFixture]
46 public class GetTextureHandlerTests 46 public class GetTextureHandlerTests : OpenSimTestCase
47 { 47 {
48 [Test] 48 [Test]
49 public void TestTextureNotFound() 49 public void TestTextureNotFound()
diff --git a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
index a681fb6..f8f63f4 100644
--- a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
+++ b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.7.5.*")] 32[assembly: AssemblyVersion("0.7.6.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")] 33
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index 9a6ca86..11a2698 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -435,4 +435,4 @@ namespace OpenSim.Capabilities.Handlers
435 return llsdItem; 435 return llsdItem;
436 } 436 }
437 } 437 }
438} \ No newline at end of file 438}
diff --git a/OpenSim/Capabilities/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Properties/AssemblyInfo.cs
index 26254f2..f8a9dae 100644
--- a/OpenSim/Capabilities/Properties/AssemblyInfo.cs
+++ b/OpenSim/Capabilities/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.7.5.*")] 32[assembly: AssemblyVersion("0.7.6.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")] 33[assembly: AssemblyFileVersion("1.0.0.0")]