aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorBlueWall2011-03-21 22:06:43 -0400
committerBlueWall2011-03-21 22:06:43 -0400
commite3c327a305dcf795f372b940f34538a19bf92218 (patch)
treeb034355a12c4d87410809aa19bf6015e611e1e22 /OpenSim/Framework
parentMerge branch 'master' of /home/opensim/src/OpenSim/Core (diff)
parentThanks Kevin Cozens for a patch that: (diff)
downloadopensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.zip
opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.gz
opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.bz2
opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.xz
Merge branch 'master' of /home/opensim/src/OpenSim/Core
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs1
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs2
-rw-r--r--OpenSim/Framework/Serialization/External/OspResolver.cs19
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs42
-rw-r--r--OpenSim/Framework/Servers/HttpServer/OSHttpHandler.cs2
-rw-r--r--OpenSim/Framework/Servers/Tests/OSHttpTests.cs1
-rw-r--r--OpenSim/Framework/Tests/AnimationTests.cs1
-rw-r--r--OpenSim/Framework/Tests/PrimeNumberHelperTests.cs3
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs1
-rw-r--r--OpenSim/Framework/UndoStack.cs2
-rw-r--r--OpenSim/Framework/Util.cs13
11 files changed, 66 insertions, 21 deletions
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
181 181
182 RegisterRegionServiceHandlers(capsBase); 182 RegisterRegionServiceHandlers(capsBase);
183 RegisterInventoryServiceHandlers(capsBase); 183 RegisterInventoryServiceHandlers(capsBase);
184
185 } 184 }
186 185
187 public void RegisterRegionServiceHandlers(string capsBase) 186 public void RegisterRegionServiceHandlers(string capsBase)
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
250 { 250 {
251 get 251 get
252 { 252 {
253 //m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); 253// m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length);
254 try { return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); } 254 try { return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); }
255 catch { } 255 catch { }
256 256
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
66 UserAccount account = userService.GetUserAccount(UUID.Zero, userId); 66 UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
67 if (account != null) 67 if (account != null)
68 return MakeOspa(account.FirstName, account.LastName); 68 return MakeOspa(account.FirstName, account.LastName);
69// else
70// m_log.WarnFormat("[OSP RESOLVER]: No user account for {0}", userId);
69 71
70 return null; 72 return null;
71 } 73 }
@@ -77,6 +79,8 @@ namespace OpenSim.Framework.Serialization
77 /// <returns></returns> 79 /// <returns></returns>
78 public static string MakeOspa(string firstName, string lastName) 80 public static string MakeOspa(string firstName, string lastName)
79 { 81 {
82// m_log.DebugFormat("[OSP RESOLVER]: Making OSPA for {0} {1}", firstName, lastName);
83
80 return 84 return
81 OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName; 85 OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
82 } 86 }
@@ -97,7 +101,10 @@ namespace OpenSim.Framework.Serialization
97 public static UUID ResolveOspa(string ospa, IUserAccountService userService) 101 public static UUID ResolveOspa(string ospa, IUserAccountService userService)
98 { 102 {
99 if (!ospa.StartsWith(OSPA_PREFIX)) 103 if (!ospa.StartsWith(OSPA_PREFIX))
100 return UUID.Zero; 104 {
105// m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa);
106 return UUID.Zero;
107 }
101 108
102// m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa); 109// m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
103 110
@@ -161,7 +168,17 @@ namespace OpenSim.Framework.Serialization
161 168
162 UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName); 169 UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName);
163 if (account != null) 170 if (account != null)
171 {
172// m_log.DebugFormat(
173// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}",
174// account.PrincipalID, firstName, lastName);
175
164 return account.PrincipalID; 176 return account.PrincipalID;
177 }
178// else
179// {
180// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name);
181// }
165 182
166 // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc 183 // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc
167 /* 184 /*
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 4c35132..ccec9b7 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -378,6 +378,22 @@ namespace OpenSim.Framework.Servers.HttpServer
378 /// <param name="response"></param> 378 /// <param name="response"></param>
379 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 379 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
380 { 380 {
381 if (request.HttpMethod == String.Empty) // Can't handle empty requests, not wasting a thread
382 {
383 try
384 {
385 SendHTML500(response);
386 }
387 catch
388 {
389 }
390
391 return;
392 }
393
394 string requestMethod = request.HttpMethod;
395 string uriString = request.RawUrl;
396
381 string reqnum = "unknown"; 397 string reqnum = "unknown";
382 int tickstart = Environment.TickCount; 398 int tickstart = Environment.TickCount;
383 399
@@ -495,7 +511,7 @@ namespace OpenSim.Framework.Servers.HttpServer
495 511
496 request.InputStream.Close(); 512 request.InputStream.Close();
497 513
498 // HTTP IN support. The script engine taes it from here 514 // HTTP IN support. The script engine takes it from here
499 // Nothing to worry about for us. 515 // Nothing to worry about for us.
500 // 516 //
501 if (buffer == null) 517 if (buffer == null)
@@ -609,19 +625,19 @@ namespace OpenSim.Framework.Servers.HttpServer
609 { 625 {
610 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e); 626 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
611 } 627 }
612 catch (InvalidOperationException e) 628 catch (Exception e)
613 { 629 {
614 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); 630 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString());
615 SendHTML500(response); 631 SendHTML500(response);
616 } 632 }
617 finally 633 finally
618 { 634 {
619 // Every month or so this will wrap and give bad numbers, not really a problem 635 // Every month or so this will wrap and give bad numbers, not really a problem
620 // since its just for reporting, 200ms limit can be adjusted 636 // since its just for reporting, tickdiff limit can be adjusted
621 int tickdiff = Environment.TickCount - tickstart; 637 int tickdiff = Environment.TickCount - tickstart;
622 if (tickdiff > 500) 638 if (tickdiff > 3000)
623 m_log.InfoFormat( 639 m_log.InfoFormat(
624 "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff); 640 "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff);
625 } 641 }
626 } 642 }
627 643
@@ -785,7 +801,19 @@ namespace OpenSim.Framework.Servers.HttpServer
785 if (methodWasFound) 801 if (methodWasFound)
786 { 802 {
787 xmlRprcRequest.Params.Add(request.Url); // Param[2] 803 xmlRprcRequest.Params.Add(request.Url); // Param[2]
788 xmlRprcRequest.Params.Add(request.Headers.Get("X-Forwarded-For")); // Param[3] 804
805 string xff = "X-Forwarded-For";
806 string xfflower = xff.ToLower();
807 foreach (string s in request.Headers.AllKeys)
808 {
809 if (s != null && s.Equals(xfflower))
810 {
811 xff = xfflower;
812 break;
813 }
814 }
815 xmlRprcRequest.Params.Add(request.Headers.Get(xff)); // Param[3]
816
789 817
790 try 818 try
791 { 819 {
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
83 /// <summary> 83 /// <summary>
84 /// Regular expression used to match against path of the 84 /// Regular expression used to match against path of the
85 /// incoming HTTP request. If you want to match any string 85 /// incoming HTTP request. If you want to match any string
86 /// either use '.*' or null. To match on the emtpy string use 86 /// either use '.*' or null. To match on the empty string use
87 /// '^$'. 87 /// '^$'.
88 /// </summary> 88 /// </summary>
89 public virtual Regex Path 89 public virtual Regex Path
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;
34using HttpServer; 34using HttpServer;
35using HttpServer.FormDecoders; 35using HttpServer.FormDecoders;
36using NUnit.Framework; 36using NUnit.Framework;
37using NUnit.Framework.SyntaxHelpers;
38using OpenSim.Framework.Servers.HttpServer; 37using OpenSim.Framework.Servers.HttpServer;
39 38
40namespace OpenSim.Framework.Servers.Tests 39namespace 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 @@
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using NUnit.Framework; 30using NUnit.Framework;
31using NUnit.Framework.SyntaxHelpers;
32using OpenMetaverse; 31using OpenMetaverse;
33using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
34using OpenSim.Framework; 33using 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 @@
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using NUnit.Framework; 30using NUnit.Framework;
31using NUnit.Framework.SyntaxHelpers;
32using OpenMetaverse; 31using OpenMetaverse;
33using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
34using OpenSim.Framework; 33using OpenSim.Framework;
@@ -38,8 +37,6 @@ namespace OpenSim.Framework.Tests
38 [TestFixture] 37 [TestFixture]
39 public class PrimeNumberHelperTests 38 public class PrimeNumberHelperTests
40 { 39 {
41
42
43 [Test] 40 [Test]
44 public void TestGetPrime() 41 public void TestGetPrime()
45 { 42 {
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 @@
27 27
28using System; 28using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using NUnit.Framework.SyntaxHelpers;
31using OpenMetaverse; 30using OpenMetaverse;
32using OpenSim.Tests.Common; 31using OpenSim.Tests.Common;
33 32
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
90 return deleted; 90 return deleted;
91 } 91 }
92 else 92 else
93 throw new InvalidOperationException("Cannot pop from emtpy stack"); 93 throw new InvalidOperationException("Cannot pop from empty stack");
94 } 94 }
95 95
96 public T Peek() 96 public T Peek()
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
459 /// <param name="oldy">Old region y-coord</param> 459 /// <param name="oldy">Old region y-coord</param>
460 /// <param name="newy">New region y-coord</param> 460 /// <param name="newy">New region y-coord</param>
461 /// <returns></returns> 461 /// <returns></returns>
462 public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) 462 public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy)
463 { 463 {
464 // Eventually this will be a function of the draw distance / camera position too. 464 int dd = (int)((drawdist + Constants.RegionSize - 1) / Constants.RegionSize);
465 return (((int)Math.Abs((int)(oldx - newx)) > 1) || ((int)Math.Abs((int)(oldy - newy)) > 1)); 465
466 int startX = (int)oldx - dd;
467 int startY = (int)oldy - dd;
468
469 int endX = (int)oldx + dd;
470 int endY = (int)oldy + dd;
471
472 return (newx < startX || endX < newx || newy < startY || endY < newy);
466 } 473 }
467 474
468 public static string FieldToString(byte[] bytes) 475 public static string FieldToString(byte[] bytes)