From 22d4c52ffc374e167cb674e0e20815615d8a6927 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 24 Nov 2012 03:15:24 +0000
Subject: Consistenly make NUnit test cases inherit from OpenSimTestCase which
automatically turns off any logging enabled between tests
---
.../Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Capabilities/Handlers')
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index 761e4e7..d4d6d10 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -42,7 +42,7 @@ using OpenSim.Tests.Common.Mock;
namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
{
[TestFixture]
- public class GetTextureHandlerTests
+ public class GetTextureHandlerTests : OpenSimTestCase
{
[Test]
public void TestTextureNotFound()
--
cgit v1.1
From acc01bb85d5c5f15a3943a908433b7fe08075c93 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 6 Dec 2012 01:12:12 +0000
Subject: Allow GetTexture calls with no second value in the range header (e.g.
just 5333-)
It looks like the latest Kokua is doing this.
As per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, leaving off the second value is legal
This indicates the caller wants the rest of the entity.
---
.../Handlers/GetTexture/GetTextureHandler.cs | 35 +++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Capabilities/Handlers')
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 04cc33a..6e9094a 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -246,6 +246,11 @@ namespace OpenSim.Capabilities.Handlers
}
else
{
+ // Handle the case where no second range value was given. This is equivalent to requesting
+ // the rest of the entity.
+ if (end == -1)
+ end = int.MaxValue;
+
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
start = Utils.Clamp(start, 0, end);
int len = end - start + 1;
@@ -299,15 +304,43 @@ namespace OpenSim.Capabilities.Handlers
// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
}
+ ///
+ /// Parse a range header.
+ ///
+ ///
+ /// As per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html,
+ /// this obeys range headers with two values (e.g. 533-4165) and no second value (e.g. 533-).
+ /// Where there is no value, -1 is returned.
+ /// FIXME: Need to cover the case where only a second value is specified (e.g. -4165), probably by returning -1
+ /// for start.
+ ///
+ ///
+ /// Undefined if the parse fails.
+ /// Undefined if the parse fails.
private bool TryParseRange(string header, out int start, out int end)
{
+ start = end = 0;
+
if (header.StartsWith("bytes="))
{
string[] rangeValues = header.Substring(6).Split('-');
+
if (rangeValues.Length == 2)
{
- if (Int32.TryParse(rangeValues[0], out start) && Int32.TryParse(rangeValues[1], out end))
+ if (!Int32.TryParse(rangeValues[0], out start))
+ return false;
+
+ string rawEnd = rangeValues[1];
+
+ if (rawEnd == "")
+ {
+ end = -1;
+ return true;
+ }
+ else if (Int32.TryParse(rawEnd, out end))
+ {
return true;
+ }
}
}
--
cgit v1.1
From 68daeee4342757340177a015a30b78c54674fafc Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 6 Dec 2012 01:36:30 +0000
Subject: minor: change method doc on GetTextureHandler.TryParseRange(), mainly
to trigger another build
---
OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Capabilities/Handlers')
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 6e9094a..b497fde 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -315,8 +315,8 @@ namespace OpenSim.Capabilities.Handlers
/// for start.
///
///
- /// Undefined if the parse fails.
- /// Undefined if the parse fails.
+ /// Start of the range. Undefined if this was not a number.
+ /// End of the range. Will be -1 if no end specified. Undefined if there was a raw string but this was not a number.
private bool TryParseRange(string header, out int start, out int end)
{
start = end = 0;
--
cgit v1.1
From 1f1da230976451d30d920c237d53c699ba96b9d9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 5 Feb 2013 00:23:17 +0000
Subject: Bump version and assembly version numbers from 0.7.5 to 0.7.6
This is mostly Bluewall's work but I am also bumping the general version number
OpenSimulator 0.7.5 remains in the release candidate stage.
I'm doing this because master is significantly adding things that will not be in 0.7.5
This update should not cause issues with existing external binary DLLs because our DLLs do not have strong names
and so the exact version match requirement is not in force.
---
OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Capabilities/Handlers')
diff --git a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
index a681fb6..4ff5fe1 100644
--- a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
+++ b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
-[assembly: AssemblyVersion("0.7.5.*")]
+[assembly: AssemblyVersion("0.7.6.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
--
cgit v1.1
From 4779f7d7d5ce0e284d9ed15104389f8479b11545 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 19 Feb 2013 17:14:55 -0800
Subject: Deleted all AssemblyFileVersion directives
---
OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Capabilities/Handlers')
diff --git a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
index 4ff5fe1..f8f63f4 100644
--- a/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
+++ b/OpenSim/Capabilities/Handlers/Properties/AssemblyInfo.cs
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
// Revision
//
[assembly: AssemblyVersion("0.7.6.*")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+
--
cgit v1.1