From fc84225038a44e114fe58e4b789b746c9b7a8338 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 16 Feb 2011 08:18:49 -0800
Subject: XFF capitalization strikes again -- this time in the XMLRPC method.
mantis #5386
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 4c35132..1d05b02 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -785,7 +785,19 @@ namespace OpenSim.Framework.Servers.HttpServer
if (methodWasFound)
{
xmlRprcRequest.Params.Add(request.Url); // Param[2]
- xmlRprcRequest.Params.Add(request.Headers.Get("X-Forwarded-For")); // Param[3]
+
+ string xff = "X-Forwarded-For";
+ string xfflower = xff.ToLower();
+ foreach (string s in request.Headers.AllKeys)
+ {
+ if (s != null && s.Equals(xfflower))
+ {
+ xff = xfflower;
+ break;
+ }
+ }
+ xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3]
+
try
{
--
cgit v1.1
From 60fe3d48ee83f004861044c51537256c0c389478 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Feb 2011 23:50:54 +0000
Subject: Put some CapabilitiesModule null checks in Scene
Stop tests setting up a capabilities module by default
---
OpenSim/Framework/Capabilities/Caps.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index c2f9c3a..3be97b5 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -181,7 +181,6 @@ namespace OpenSim.Framework.Capabilities
RegisterRegionServiceHandlers(capsBase);
RegisterInventoryServiceHandlers(capsBase);
-
}
public void RegisterRegionServiceHandlers(string capsBase)
--
cgit v1.1
From 5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Tue, 22 Feb 2011 13:23:54 -0800
Subject: Parameterizes the view distance used to compute and manage child
agents in neighbor regions. This means you can extend the view on a simulator
beyond the default 3x3 regions.
This uses a region default draw distance and should be
replaced at some point by the avatar specified draw distance.
That will require more careful, dynamic recomputation of child
agents every time the draw distance changes.
WARNING: this is experimental and has known instabilities. specifically
all regions "within site" should be running the same default draw distance
or agents will not be closed correctly.
---
OpenSim/Framework/Util.cs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 533e53a..5a5046e 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -459,10 +459,17 @@ namespace OpenSim.Framework
/// Old region y-coord
/// New region y-coord
///
- public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy)
+ public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy)
{
- // Eventually this will be a function of the draw distance / camera position too.
- return (((int)Math.Abs((int)(oldx - newx)) > 1) || ((int)Math.Abs((int)(oldy - newy)) > 1));
+ int dd = (int)((drawdist + Constants.RegionSize - 1) / Constants.RegionSize);
+
+ int startX = (int)oldx - dd;
+ int startY = (int)oldy - dd;
+
+ int endX = (int)oldx + dd;
+ int endY = (int)oldy + dd;
+
+ return (newx < startX || endX < newx || newy < startY || endY < newy);
}
public static string FieldToString(byte[] bytes)
--
cgit v1.1
From 9f85ee29ac9f5e0aa8c1976944f9af12da3514db Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 5 Mar 2011 02:18:03 +0000
Subject: Change MoapModule.ClearMediaEntry to set TextureEntryFace.MediaFlags
back to false
Implement test for ClearMediaEntry()
---
OpenSim/Framework/PrimitiveBaseShape.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 927415e..7b5fb2e 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -250,7 +250,7 @@ namespace OpenSim.Framework
{
get
{
- //m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length);
+// m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length);
try { return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); }
catch { }
--
cgit v1.1
From 8a2360bf815d4d78fcff34a69dec24782494bd2e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 9 Mar 2011 01:21:31 +0000
Subject: Simplify TestLoadIarV0_1AbsentUsers() to use common IAR test setup.
Make static dictionaries on NullUserAccountData instance instead to stop user
accounts being carried over between tests
---
.../Framework/Serialization/External/OspResolver.cs | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Serialization/External/OspResolver.cs b/OpenSim/Framework/Serialization/External/OspResolver.cs
index 7e3dd1b..d31d27c 100644
--- a/OpenSim/Framework/Serialization/External/OspResolver.cs
+++ b/OpenSim/Framework/Serialization/External/OspResolver.cs
@@ -66,6 +66,8 @@ namespace OpenSim.Framework.Serialization
UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
if (account != null)
return MakeOspa(account.FirstName, account.LastName);
+// else
+// m_log.WarnFormat("[OSP RESOLVER]: No user account for {0}", userId);
return null;
}
@@ -77,6 +79,8 @@ namespace OpenSim.Framework.Serialization
///
public static string MakeOspa(string firstName, string lastName)
{
+// m_log.DebugFormat("[OSP RESOLVER]: Making OSPA for {0} {1}", firstName, lastName);
+
return
OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
}
@@ -97,7 +101,10 @@ namespace OpenSim.Framework.Serialization
public static UUID ResolveOspa(string ospa, IUserAccountService userService)
{
if (!ospa.StartsWith(OSPA_PREFIX))
- return UUID.Zero;
+ {
+// m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa);
+ return UUID.Zero;
+ }
// m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
@@ -161,7 +168,17 @@ namespace OpenSim.Framework.Serialization
UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName);
if (account != null)
+ {
+// m_log.DebugFormat(
+// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}",
+// account.PrincipalID, firstName, lastName);
+
return account.PrincipalID;
+ }
+// else
+// {
+// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name);
+// }
// XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc
/*
--
cgit v1.1
From 9456bb77fbf794bb6fc2808e6cfd69c9bb1d1326 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 9 Mar 2011 23:25:24 +0000
Subject: Upgrade nunit.framework.dll to version 2.5.9. Fix up tests
appropriately.
This version removes the NUnit.Framework.SyntaxHelpers namespace, so any modules with their own tests will need to delete this using statement.
---
OpenSim/Framework/Servers/Tests/OSHttpTests.cs | 1 -
OpenSim/Framework/Tests/AnimationTests.cs | 1 -
OpenSim/Framework/Tests/PrimeNumberHelperTests.cs | 3 ---
OpenSim/Framework/Tests/UtilTest.cs | 1 -
4 files changed, 6 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
index e62407a..dc4eb8f 100644
--- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
+++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
@@ -34,7 +34,6 @@ using System.Text;
using HttpServer;
using HttpServer.FormDecoders;
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using OpenSim.Framework.Servers.HttpServer;
namespace OpenSim.Framework.Servers.Tests
diff --git a/OpenSim/Framework/Tests/AnimationTests.cs b/OpenSim/Framework/Tests/AnimationTests.cs
index 719ddce..9aa95af 100644
--- a/OpenSim/Framework/Tests/AnimationTests.cs
+++ b/OpenSim/Framework/Tests/AnimationTests.cs
@@ -28,7 +28,6 @@
using System;
using System.Reflection;
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
diff --git a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
index d741f91..36bc6e7 100644
--- a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
+++ b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
@@ -28,7 +28,6 @@
using System;
using System.Reflection;
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
@@ -38,8 +37,6 @@ namespace OpenSim.Framework.Tests
[TestFixture]
public class PrimeNumberHelperTests
{
-
-
[Test]
public void TestGetPrime()
{
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index 89f5c0c..5eac411 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -27,7 +27,6 @@
using System;
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
using OpenSim.Tests.Common;
--
cgit v1.1
From cee5e3e264a71861dd018ee9bad47e6ea2ac0338 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 14 Mar 2011 12:56:50 +0100
Subject: Up the timeout on slow requests to 3000 to stop console spam. Make
sure request method and target are reported correctly and drop the txn id as
it's empty 99% of the time.
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 26 +++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 1d05b02..953ed85 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -378,6 +378,22 @@ namespace OpenSim.Framework.Servers.HttpServer
///
public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
{
+ if (request.HttpMethod == String.Empty) // Can't handle empty requests, not wasting a thread
+ {
+ try
+ {
+ SendHTML500(response);
+ }
+ catch
+ {
+ }
+
+ return;
+ }
+
+ string requestMethod = request.HttpMethod;
+ string uriString = request.RawUrl;
+
string reqnum = "unknown";
int tickstart = Environment.TickCount;
@@ -495,7 +511,7 @@ namespace OpenSim.Framework.Servers.HttpServer
request.InputStream.Close();
- // HTTP IN support. The script engine taes it from here
+ // HTTP IN support. The script engine takes it from here
// Nothing to worry about for us.
//
if (buffer == null)
@@ -609,9 +625,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
}
- catch (InvalidOperationException e)
+ catch (Exception e)
{
- m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
+ m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString());
SendHTML500(response);
}
finally
@@ -619,9 +635,9 @@ namespace OpenSim.Framework.Servers.HttpServer
// Every month or so this will wrap and give bad numbers, not really a problem
// since its just for reporting, 200ms limit can be adjusted
int tickdiff = Environment.TickCount - tickstart;
- if (tickdiff > 500)
+ if (tickdiff > 3000)
m_log.InfoFormat(
- "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff);
+ "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff);
}
}
--
cgit v1.1
From aadd0e8d42b0a5b401cde9d4d3a56ce2e527201a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 16 Mar 2011 00:14:58 +0000
Subject: minor: bring comment into line with code reality
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 953ed85..ccec9b7 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -633,7 +633,7 @@ namespace OpenSim.Framework.Servers.HttpServer
finally
{
// Every month or so this will wrap and give bad numbers, not really a problem
- // since its just for reporting, 200ms limit can be adjusted
+ // since its just for reporting, tickdiff limit can be adjusted
int tickdiff = Environment.TickCount - tickstart;
if (tickdiff > 3000)
m_log.InfoFormat(
--
cgit v1.1
From a3651eb5d0325807baa9a2bdc9a1bae8d413bc9f Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Thu, 17 Mar 2011 05:48:42 -0400
Subject: Thanks Kevin Cozens for a patch that:
Fixes several spelling mistakes
---
OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs | 2 +-
OpenSim/Framework/UndoStack.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs
index 129a544..2c2b47d 100644
--- a/OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Servers.HttpServer
///
/// Regular expression used to match against path of the
/// incoming HTTP request. If you want to match any string
- /// either use '.*' or null. To match on the emtpy string use
+ /// either use '.*' or null. To match on the empty string use
/// '^$'.
///
public virtual Regex Path
diff --git a/OpenSim/Framework/UndoStack.cs b/OpenSim/Framework/UndoStack.cs
index 4d800ae..fde63b1 100644
--- a/OpenSim/Framework/UndoStack.cs
+++ b/OpenSim/Framework/UndoStack.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Framework
return deleted;
}
else
- throw new InvalidOperationException("Cannot pop from emtpy stack");
+ throw new InvalidOperationException("Cannot pop from empty stack");
}
public T Peek()
--
cgit v1.1