diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs
index e1c800e907..a0e9ebca47 100644
--- a/OpenSim/Capabilities/CapsHandlers.cs
+++ b/OpenSim/Capabilities/CapsHandlers.cs
@@ -147,25 +147,25 @@ namespace OpenSim.Framework.Capabilities
/// Return an LLSD-serializable Hashtable describing the
/// capabilities and their handler details.
///
- public Hashtable CapsDetails
+ /// If true, then exclude the seed cap.
+ public Hashtable GetCapsDetails(bool excludeSeed)
{
- get
- {
- Hashtable caps = new Hashtable();
- string protocol = "http://";
-
- if (m_useSSL)
- protocol = "https://";
+ Hashtable caps = new Hashtable();
+ string protocol = "http://";
+
+ if (m_useSSL)
+ protocol = "https://";
- string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString();
- foreach (string capsName in m_capsHandlers.Keys)
- {
- // skip SEED cap
- if ("SEED" == capsName) continue;
- caps[capsName] = baseUrl + m_capsHandlers[capsName].Path;
- }
- return caps;
+ string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString();
+ foreach (string capsName in m_capsHandlers.Keys)
+ {
+ if (excludeSeed && "SEED" == capsName)
+ continue;
+
+ caps[capsName] = baseUrl + m_capsHandlers[capsName].Path;
}
+
+ return caps;
}
}
}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index b45ed7b229..04739feab2 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -79,6 +79,11 @@ namespace OpenSim.Framework.Servers.HttpServer
private PollServiceRequestManager m_PollServiceManager;
+ ///
+ /// Control the printing of certain debug messages.
+ ///
+ public int DebugLevel { get; set; }
+
public uint SSLPort
{
get { return m_sslport; }
@@ -442,17 +447,18 @@ namespace OpenSim.Framework.Servers.HttpServer
string path = request.RawUrl;
string handlerKey = GetHandlerKey(request.HttpMethod, path);
-// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
-
if (TryGetStreamHandler(handlerKey, out requestHandler))
{
- //m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler");
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found stream handler for {0} {1}",
+ request.HttpMethod, request.Url.PathAndQuery);
+
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
byte[] buffer = null;
response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type.
-
if (requestHandler is IStreamedRequestHandler)
{
IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
@@ -480,7 +486,6 @@ namespace OpenSim.Framework.Servers.HttpServer
string[] querystringkeys = request.QueryString.AllKeys;
string[] rHeaders = request.Headers.AllKeys;
-
foreach (string queryname in querystringkeys)
{
keysvals.Add(queryname, request.QueryString[queryname]);
@@ -556,6 +561,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
}
+
return;
}
@@ -566,7 +572,11 @@ namespace OpenSim.Framework.Servers.HttpServer
if (strAccept.Contains("application/llsd+xml") ||
strAccept.Contains("application/llsd+json"))
{
- //m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header");
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found application/llsd+xml accept header handler for {0} {1}",
+ request.HttpMethod, request.Url.PathAndQuery);
+
HandleLLSDRequests(request, response);
return;
}
@@ -577,15 +587,24 @@ namespace OpenSim.Framework.Servers.HttpServer
{
case null:
case "text/html":
-// m_log.DebugFormat(
-// "[BASE HTTP SERVER]: Found a text/html content type for request {0}", request.RawUrl);
+
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
+ request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
+
HandleHTTPRequest(request, response);
return;
case "application/llsd+xml":
case "application/xml+llsd":
case "application/llsd+json":
- //m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type");
+
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
+ request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
+
HandleLLSDRequests(request, response);
return;
@@ -602,7 +621,11 @@ namespace OpenSim.Framework.Servers.HttpServer
//m_log.Info("[Debug BASE HTTP SERVER]: Checking for LLSD Handler");
if (DoWeHaveALLSDHandler(request.RawUrl))
{
- //m_log.Info("[Debug BASE HTTP SERVER]: Found LLSD Handler");
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
+ request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
+
HandleLLSDRequests(request, response);
return;
}
@@ -610,12 +633,20 @@ namespace OpenSim.Framework.Servers.HttpServer
// m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl);
if (DoWeHaveAHTTPHandler(request.RawUrl))
{
-// m_log.DebugFormat("[BASE HTTP SERVER]: Found HTTP Handler for request {0}", request.RawUrl);
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
+ request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
+
HandleHTTPRequest(request, response);
return;
}
- //m_log.Info("[Debug BASE HTTP SERVER]: Generic XMLRPC");
+ if (DebugLevel >= 1)
+ m_log.DebugFormat(
+ "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}",
+ request.HttpMethod, request.Url.PathAndQuery);
+
// generic login request.
HandleXmlRpcRequests(request, response);
@@ -872,7 +903,9 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buf = Encoding.UTF8.GetBytes("Not found");
response.KeepAlive = false;
- m_log.ErrorFormat("[BASE HTTP SERVER]: Handler not found for http request {0}", request.RawUrl);
+ m_log.ErrorFormat(
+ "[BASE HTTP SERVER]: Handler not found for http request {0} {1}",
+ request.HttpMethod, request.Url.PathAndQuery);
response.SendChunked = false;
response.ContentLength64 = buf.Length;
@@ -978,7 +1011,6 @@ namespace OpenSim.Framework.Servers.HttpServer
if (llsdRequest != null)// && m_defaultLlsdHandler != null)
{
-
LLSDMethod llsdhandler = null;
if (TryGetLLSDHandler(request.RawUrl, out llsdhandler) && !LegacyLLSDLoginLibOMV)
@@ -1002,13 +1034,14 @@ namespace OpenSim.Framework.Servers.HttpServer
llsdResponse = GenerateNoLLSDHandlerResponse();
}
}
-
}
else
{
llsdResponse = GenerateNoLLSDHandlerResponse();
}
+
byte[] buffer = new byte[0];
+
if (llsdResponse.ToString() == "shutdown404!")
{
response.ContentType = "text/plain";
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index f6ce29142f..b4dbeaee76 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -242,6 +242,14 @@ namespace OpenSim
+ "If an avatar name is given then only packets from that avatar are logged",
Debug);
+ m_console.Commands.AddCommand("region", false, "debug http",
+ "debug http ",
+ "Turn on inbound http request debugging for everything except the event queue (see debug eq).",
+ "If level >= 2 then the handler used to service the request is logged.\n"
+ + "If level >= 1 then incoming HTTP requests are logged.\n"
+ + "If level <= 0 then no extra http logging is done.\n",
+ Debug);
+
m_console.Commands.AddCommand("region", false, "debug scene",
"debug scene ",
"Turn on scene debugging", Debug);
@@ -337,7 +345,7 @@ namespace OpenSim
m_console.Commands.AddCommand("region", false, "backup",
"backup",
- "Persist objects to the database now", RunCommand);
+ "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand);
m_console.Commands.AddCommand("region", false, "create region",
"create region [\"region name\"] ",
@@ -886,15 +894,32 @@ namespace OpenSim
if (int.TryParse(args[2], out newDebug))
{
m_sceneManager.SetDebugPacketLevelOnCurrentScene(newDebug, name);
+ // We provide user information elsewhere if any clients had their debug level set.
+// MainConsole.Instance.OutputFormat("Debug packet level set to {0}", newDebug);
}
else
{
- MainConsole.Instance.Output("packet debug should be 0..255");
+ MainConsole.Instance.Output("Usage: debug packet 0..255");
}
}
break;
+ case "http":
+ if (args.Length == 3)
+ {
+ int newDebug;
+ if (int.TryParse(args[2], out newDebug))
+ {
+ MainServer.Instance.DebugLevel = newDebug;
+ MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug);
+ break;
+ }
+ }
+
+ MainConsole.Instance.Output("Usage: debug http 0..2");
+ break;
+
case "scene":
if (args.Length == 5)
{
@@ -917,13 +942,13 @@ namespace OpenSim
}
else
{
- MainConsole.Instance.Output("debug scene (where inside <> is true/false)");
+ MainConsole.Instance.Output("Usage: debug scene (where inside <> is true/false)");
}
break;
default:
- MainConsole.Instance.Output("Unknown debug");
+ MainConsole.Instance.Output("Unknown debug command");
break;
}
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 8f0ae76e20..07b4df3d3b 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -238,7 +238,8 @@ namespace OpenSim.Region.ClientStack.Linden
return string.Empty;
}
- Hashtable caps = m_HostCapsObj.CapsHandlers.CapsDetails;
+ Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true);
+
// Add the external too
foreach (KeyValuePair kvp in m_HostCapsObj.ExternalCapsHandlers)
caps[kvp.Key] = kvp.Value;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 5c721d41e9..9f27abc5e7 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -110,8 +110,9 @@ namespace OpenSim.Region.ClientStack.Linden
false,
"debug eq",
"debug eq [0|1]",
+ "Turn on event queue debugging",
"debug eq 1 will turn on event queue debugging. This will log all outgoing event queue messages to clients.\n"
- + "debug eq 1 will turn off event queue debugging.",
+ + "debug eq 0 will turn off event queue debugging.",
HandleDebugEq);
}
else
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
index babeaabee6..97cd7383fa 100644
--- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
+using System.Text;
using log4net;
using Nini.Config;
using Mono.Addins;
@@ -46,6 +47,8 @@ namespace OpenSim.Region.CoreModules.Framework
public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
+ private string m_showCapsCommandFormat = " {0,-38} {1,-60}\n";
protected Scene m_scene;
@@ -68,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Framework
m_scene.RegisterModuleInterface(this);
MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
"show caps",
- "Shows all registered capabilities", CapabilitiesCommand);
+ "Shows all registered capabilities", HandleShowCapsCommand);
}
public void RegionLoaded(Scene scene)
@@ -228,21 +231,23 @@ namespace OpenSim.Region.CoreModules.Framework
}
}
- private void CapabilitiesCommand(string module, string[] cmdparams)
+ private void HandleShowCapsCommand(string module, string[] cmdparams)
{
- System.Text.StringBuilder caps = new System.Text.StringBuilder();
+ StringBuilder caps = new StringBuilder();
caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName);
foreach (KeyValuePair kvp in m_capsObjects)
{
caps.AppendFormat("** User {0}:\n", kvp.Key);
- for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); )
+
+ for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false).GetEnumerator(); kvp2.MoveNext(); )
{
Uri uri = new Uri(kvp2.Value.ToString());
- caps.AppendFormat(" {0} = {1}\n", kvp2.Key, uri.PathAndQuery);
+ caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery);
}
+
foreach (KeyValuePair kvp3 in kvp.Value.ExternalCapsHandlers)
- caps.AppendFormat(" {0} = {1}\n", kvp3.Key, kvp3.Value);
+ caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value);
}
MainConsole.Instance.Output(caps.ToString());
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 3963474a58..c1b87646aa 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -218,9 +218,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.AddCommand(this, "debug permissions",
"debug permissions ",
- "Enable permissions debugging",
- HandleDebugPermissions);
-
+ "Turn on permissions debugging",
+ HandleDebugPermissions);
string grant = myConfig.GetString("GrantLSL","");
if (grant.Length > 0) {
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 53d5e4c33f..f15e81ba8e 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -171,16 +171,13 @@ namespace OpenSim.Region.Physics.Meshing
foreach (Vector3 v in meshIn.getVertexList())
{
- if (v != null)
- {
- if (v.X < minX) minX = v.X;
- if (v.Y < minY) minY = v.Y;
- if (v.Z < minZ) minZ = v.Z;
+ if (v.X < minX) minX = v.X;
+ if (v.Y < minY) minY = v.Y;
+ if (v.Z < minZ) minZ = v.Z;
- if (v.X > maxX) maxX = v.X;
- if (v.Y > maxY) maxY = v.Y;
- if (v.Z > maxZ) maxZ = v.Z;
- }
+ if (v.X > maxX) maxX = v.X;
+ if (v.Y > maxY) maxY = v.Y;
+ if (v.Z > maxZ) maxZ = v.Z;
}
return CreateSimpleBoxMesh(minX, maxX, minY, maxY, minZ, maxZ);