From 55974df14b6d64c1e1f9e386a3eacce3ba86dc98 Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Sat, 2 Oct 2010 19:17:02 -0400
Subject: * refactor refactor refactor ServerURI 4 lyfe
---
OpenSim/Framework/RegionInfo.cs | 8 +++++++-
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 10 +++++-----
2 files changed, 12 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 08d5398..949a289 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -116,7 +116,13 @@ namespace OpenSim.Framework
public string ServerURI
{
get { return m_serverURI; }
- set { m_serverURI = value; }
+ set {
+ if ( value.EndsWith("/") ) {
+ m_serverURI = value;
+ } else {
+ m_serverURI = value + '/';
+ }
+ }
}
protected string m_serverURI;
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ba8c194..47e86ad 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
-// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
+ m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
@@ -376,11 +376,11 @@ 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);
+ 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");
+ m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler");
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
byte[] buffer = null;
@@ -395,7 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
else if (requestHandler is IGenericHTTPHandler)
{
- //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
+ m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
Stream requestStream = request.InputStream;
@@ -422,7 +422,7 @@ namespace OpenSim.Framework.Servers.HttpServer
foreach (string headername in rHeaders)
{
- //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
+ m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
headervals[headername] = request.Headers[headername];
}
--
cgit v1.1
From 58f75fa19d9aea18283ecdbd44559efb81781c9d Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Mon, 11 Oct 2010 16:53:00 -0400
Subject: * more url / hg cleanup
---
OpenSim/Framework/Capabilities/CapsUtil.cs | 2 +-
OpenSim/Framework/RegionInfo.cs | 31 +++++++++++++++++++++++++++---
2 files changed, 29 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index 0334e4b..faf2708 100644
--- a/OpenSim/Framework/Capabilities/CapsUtil.cs
+++ b/OpenSim/Framework/Capabilities/CapsUtil.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Capabilities
///
public static string GetCapsSeedPath(string capsObjectPath)
{
- return "/CAPS/" + capsObjectPath + "0000/";
+ return "CAPS/" + capsObjectPath + "0000/";
}
///
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 949a289..73b8bd0 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -115,7 +115,13 @@ namespace OpenSim.Framework
///
public string ServerURI
{
- get { return m_serverURI; }
+ get {
+ if ( m_serverURI != string.Empty ) {
+ return m_serverURI;
+ } else {
+ return "http://" + m_externalHostName + ":" + m_httpPort + "/";
+ }
+ }
set {
if ( value.EndsWith("/") ) {
m_serverURI = value;
@@ -147,6 +153,7 @@ namespace OpenSim.Framework
public SimpleRegionInfo()
{
+ m_serverURI = string.Empty;
}
public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -156,6 +163,7 @@ namespace OpenSim.Framework
m_internalEndPoint = internalEndPoint;
m_externalHostName = externalUri;
+ m_serverURI = string.Empty;
}
public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
@@ -166,6 +174,7 @@ namespace OpenSim.Framework
m_externalHostName = externalUri;
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
+ m_serverURI = string.Empty;
}
public SimpleRegionInfo(RegionInfo ConvertFrom)
@@ -455,6 +464,7 @@ namespace OpenSim.Framework
configMember =
new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
configMember.performConfigurationRetrieve();
+ m_serverURI = string.Empty;
}
public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -464,10 +474,12 @@ namespace OpenSim.Framework
m_internalEndPoint = internalEndPoint;
m_externalHostName = externalUri;
+ m_serverURI = string.Empty;
}
public RegionInfo()
{
+ m_serverURI = string.Empty;
}
public EstateSettings EstateSettings
@@ -557,10 +569,23 @@ namespace OpenSim.Framework
///
/// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
///
+
public string ServerURI
{
- get { return m_serverURI; }
- set { m_serverURI = value; }
+ get {
+ if ( m_serverURI != string.Empty ) {
+ return m_serverURI;
+ } else {
+ return "http://" + m_externalHostName + ":" + m_httpPort + "/";
+ }
+ }
+ set {
+ if ( value.EndsWith("/") ) {
+ m_serverURI = value;
+ } else {
+ m_serverURI = value + '/';
+ }
+ }
}
public string RegionName
--
cgit v1.1
From 017b83d0a3e3ac6a1c8bc86b9bef1ee47cba059e Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Wed, 20 Oct 2010 02:36:59 -0400
Subject: * remove some spurious debug info * The last 4 commits are a patch
from otakup0pe that's supposed to make URLs better somehow in an effort to
make it easier to do hypergrid (I think).. But as it seems that I'm the
only one who was able to apply the patch.. and I looked it over and it
doesn't look like it breaks anything via the diffs.. I'll sign off on it.
Signed-off-by: Teravus Ovares (Dan Olivares)
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 47e86ad..0c1e5e0 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
- m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
+ //m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
@@ -376,11 +376,11 @@ 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);
+ //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");
+ //m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler");
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
byte[] buffer = null;
@@ -395,7 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
else if (requestHandler is IGenericHTTPHandler)
{
- m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
+ //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
Stream requestStream = request.InputStream;
@@ -422,7 +422,7 @@ namespace OpenSim.Framework.Servers.HttpServer
foreach (string headername in rHeaders)
{
- m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
+ //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
headervals[headername] = request.Headers[headername];
}
--
cgit v1.1