From e29d563557bbe3a5a8f3aaf883ca92770a586e10 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 21 Sep 2012 00:09:17 +0100
Subject: Add request number counting to incoming HTTP requests in the same way
that this was already being done for outgoing HTTP requests.
This allows us to associate debug logging messages with the right request.
It also allows us to put a request number on 'long request' logging even if other debug logging is not enabled, which gives us some idea of whether every request is suffering this problem or only some.
This is a separate internal number not associated with any incoming number in the opensim-request-id header, this will be clarified when logging of this incoming request number is re-enabled.
This commit also adds port number to HTTP IN logging to allow us to distinguish between different request numbers on different ports.
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 59 +++++++++++++++-------
OpenSim/Framework/WebUtil.cs | 2 +-
2 files changed, 42 insertions(+), 19 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 4e04dd8..05c2d53 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -62,6 +62,15 @@ namespace OpenSim.Framework.Servers.HttpServer
///
public int DebugLevel { get; set; }
+ ///
+ /// Request number for diagnostic purposes.
+ ///
+ ///
+ /// This is an internal number. In some debug situations an external number may also be supplied in the
+ /// opensim-request-id header but we are not currently logging this.
+ ///
+ public int RequestNumber { get; private set; }
+
private volatile int NotSocketErrors = 0;
public volatile bool HTTPDRunning = false;
@@ -302,6 +311,8 @@ namespace OpenSim.Framework.Servers.HttpServer
private void OnRequest(object source, RequestEventArgs args)
{
+ RequestNumber++;
+
try
{
IHttpClientContext context = (IHttpClientContext)source;
@@ -411,7 +422,6 @@ namespace OpenSim.Framework.Servers.HttpServer
string requestMethod = request.HttpMethod;
string uriString = request.RawUrl;
-// string reqnum = "unknown";
int requestStartTick = Environment.TickCount;
// Will be adjusted later on.
@@ -535,8 +545,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (DebugLevel >= 3)
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}",
- request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
+ RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
buffer = HandleHTTPRequest(request, response);
break;
@@ -547,8 +557,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (DebugLevel >= 3)
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}",
- request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
+ RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
buffer = HandleLLSDRequests(request, response);
break;
@@ -641,7 +651,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (tickdiff > 3000)
{
m_log.InfoFormat(
- "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms",
+ "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
+ RequestNumber,
requestMethod,
uriString,
requestHandler != null ? requestHandler.Name : "",
@@ -652,12 +663,9 @@ namespace OpenSim.Framework.Servers.HttpServer
else if (DebugLevel >= 4)
{
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN {0} {1} {2} {3} from {4} took {5}ms",
- requestMethod,
- uriString,
- requestHandler != null ? requestHandler.Name : "",
- requestHandler != null ? requestHandler.Description : "",
- request.RemoteIPEndPoint,
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} took {2}ms",
+ RequestNumber,
+ Port,
tickdiff);
}
}
@@ -666,8 +674,14 @@ namespace OpenSim.Framework.Servers.HttpServer
private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler)
{
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3} from {4}",
- request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description, request.RemoteIPEndPoint);
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} stream handler {2} {3} {4} {5} from {6}",
+ RequestNumber,
+ Port,
+ request.HttpMethod,
+ request.Url.PathAndQuery,
+ requestHandler.Name,
+ requestHandler.Description,
+ request.RemoteIPEndPoint);
if (DebugLevel >= 5)
LogIncomingInDetail(request);
@@ -676,8 +690,13 @@ namespace OpenSim.Framework.Servers.HttpServer
private void LogIncomingToContentTypeHandler(OSHttpRequest request)
{
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}",
- request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
+ RequestNumber,
+ Port,
+ request.ContentType,
+ request.HttpMethod,
+ request.Url.PathAndQuery,
+ request.RemoteIPEndPoint);
if (DebugLevel >= 5)
LogIncomingInDetail(request);
@@ -686,8 +705,12 @@ namespace OpenSim.Framework.Servers.HttpServer
private void LogIncomingToXmlRpcHandler(OSHttpRequest request)
{
m_log.DebugFormat(
- "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1} from {2}",
- request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
+ "[BASE HTTP SERVER]: HTTP IN {0} :{1} assumed generic XMLRPC request {2} {3} from {4}",
+ RequestNumber,
+ Port,
+ request.HttpMethod,
+ request.Url.PathAndQuery,
+ request.RemoteIPEndPoint);
if (DebugLevel >= 5)
LogIncomingInDetail(request);
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 64d61f1..e095402 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Framework
///
/// Request number for diagnostic purposes.
///
- public static int RequestNumber = 0;
+ public static int RequestNumber { get; internal set; }
///
/// this is the header field used to communicate the local request id
--
cgit v1.1
From 1b0abf8f0cd417e2a37cffc96379274ad98183f2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 21 Sep 2012 00:29:13 +0100
Subject: Comment out the long unused afaik HTTP agent handlers.
As far as I know, this was only used by the IBM Rest modules, much of which has been commented out for a very long time now. Other similar code uses HTTP or stream handlers instead.
So commenting this out to reduce code complexity and the need to make this facility consistent with the others where it may not be used anyway.
If this facility is actually being used then please notify me or uncomment it if you are core.
---
.../Rest/Inventory/RestHandler.cs | 30 +++--
OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | 14 +-
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 146 ++++++++++-----------
.../Servers/HttpServer/Interfaces/IHttpServer.cs | 22 ++--
OpenSim/Framework/Servers/MainServer.cs | 6 +-
5 files changed, 112 insertions(+), 106 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
index cb88695..072bd6f 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
@@ -312,14 +312,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// Now that everything is setup we can proceed to
// add THIS agent to the HTTP server's handler list
- if (!AddAgentHandler(Rest.Name,this))
- {
- Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
- foreach (IRest handler in handlers)
- {
- handler.Close();
- }
- }
+ // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
+ // have to be handled through the AddHttpHandler interface.
+// if (!AddAgentHandler(Rest.Name,this))
+// {
+// Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
+// foreach (IRest handler in handlers)
+// {
+// handler.Close();
+// }
+// }
}
catch (Exception e)
@@ -342,11 +344,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
- try
- {
- RemoveAgentHandler(Rest.Name, this);
- }
- catch (KeyNotFoundException){}
+ // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
+ // have to be handled through the AddHttpHandler interface.
+// try
+// {
+// RemoveAgentHandler(Rest.Name, this);
+// }
+// catch (KeyNotFoundException){}
foreach (IRest handler in handlers)
{
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
index eb16750..a2425b5 100644
--- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
+++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
@@ -297,7 +297,9 @@ namespace OpenSim.ApplicationPlugins.Rest
{
if (!IsEnabled) return false;
_agents.Add(agentName, handler);
- return _httpd.AddAgentHandler(agentName, handler);
+// return _httpd.AddAgentHandler(agentName, handler);
+
+ return false;
}
///
@@ -316,7 +318,7 @@ namespace OpenSim.ApplicationPlugins.Rest
if (_agents[agentName] == handler)
{
_agents.Remove(agentName);
- return _httpd.RemoveAgentHandler(agentName, handler);
+// return _httpd.RemoveAgentHandler(agentName, handler);
}
return false;
}
@@ -358,10 +360,10 @@ namespace OpenSim.ApplicationPlugins.Rest
_httpd.RemoveStreamHandler(h.HttpMethod, h.Path);
}
_handlers = null;
- foreach (KeyValuePair h in _agents)
- {
- _httpd.RemoveAgentHandler(h.Key, h.Value);
- }
+// foreach (KeyValuePair h in _agents)
+// {
+// _httpd.RemoveAgentHandler(h.Key, h.Value);
+// }
_agents = null;
}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 05c2d53..8c29ad4 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -82,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer
protected Dictionary m_llsdHandlers = new Dictionary();
protected Dictionary m_streamHandlers = new Dictionary();
protected Dictionary m_HTTPHandlers = new Dictionary();
- protected Dictionary m_agentHandlers = new Dictionary();
+// protected Dictionary m_agentHandlers = new Dictionary();
protected Dictionary m_pollHandlers =
new Dictionary();
@@ -260,29 +260,29 @@ namespace OpenSim.Framework.Servers.HttpServer
return new List(m_pollHandlers.Keys);
}
- // Note that the agent string is provided simply to differentiate
- // the handlers - it is NOT required to be an actual agent header
- // value.
- public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
- {
- lock (m_agentHandlers)
- {
- if (!m_agentHandlers.ContainsKey(agent))
- {
- m_agentHandlers.Add(agent, handler);
- return true;
- }
- }
-
- //must already have a handler for that path so return false
- return false;
- }
-
- public List GetAgentHandlerKeys()
- {
- lock (m_agentHandlers)
- return new List(m_agentHandlers.Keys);
- }
+// // Note that the agent string is provided simply to differentiate
+// // the handlers - it is NOT required to be an actual agent header
+// // value.
+// public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
+// {
+// lock (m_agentHandlers)
+// {
+// if (!m_agentHandlers.ContainsKey(agent))
+// {
+// m_agentHandlers.Add(agent, handler);
+// return true;
+// }
+// }
+//
+// //must already have a handler for that path so return false
+// return false;
+// }
+//
+// public List GetAgentHandlerKeys()
+// {
+// lock (m_agentHandlers)
+// return new List(m_agentHandlers.Keys);
+// }
public bool AddLLSDHandler(string path, LLSDMethod handler)
{
@@ -438,22 +438,22 @@ namespace OpenSim.Framework.Servers.HttpServer
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
- // This is the REST agent interface. We require an agent to properly identify
- // itself. If the REST handler recognizes the prefix it will attempt to
- // satisfy the request. If it is not recognizable, and no damage has occurred
- // the request can be passed through to the other handlers. This is a low
- // probability event; if a request is matched it is normally expected to be
- // handled
- IHttpAgentHandler agentHandler;
-
- if (TryGetAgentHandler(request, response, out agentHandler))
- {
- if (HandleAgentRequest(agentHandler, request, response))
- {
- requestEndTick = Environment.TickCount;
- return;
- }
- }
+// // This is the REST agent interface. We require an agent to properly identify
+// // itself. If the REST handler recognizes the prefix it will attempt to
+// // satisfy the request. If it is not recognizable, and no damage has occurred
+// // the request can be passed through to the other handlers. This is a low
+// // probability event; if a request is matched it is normally expected to be
+// // handled
+// IHttpAgentHandler agentHandler;
+//
+// if (TryGetAgentHandler(request, response, out agentHandler))
+// {
+// if (HandleAgentRequest(agentHandler, request, response))
+// {
+// requestEndTick = Environment.TickCount;
+// return;
+// }
+// }
//response.KeepAlive = true;
response.SendChunked = false;
@@ -830,24 +830,24 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
- {
- agentHandler = null;
-
- lock (m_agentHandlers)
- {
- foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
- {
- if (handler.Match(request, response))
- {
- agentHandler = handler;
- return true;
- }
- }
- }
-
- return false;
- }
+// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
+// {
+// agentHandler = null;
+//
+// lock (m_agentHandlers)
+// {
+// foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
+// {
+// if (handler.Match(request, response))
+// {
+// agentHandler = handler;
+// return true;
+// }
+// }
+// }
+//
+// return false;
+// }
///
/// Try all the registered xmlrpc handlers when an xmlrpc request is received.
@@ -1772,21 +1772,21 @@ namespace OpenSim.Framework.Servers.HttpServer
m_pollHandlers.Remove(path);
}
- public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
- {
- lock (m_agentHandlers)
- {
- IHttpAgentHandler foundHandler;
-
- if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
- {
- m_agentHandlers.Remove(agent);
- return true;
- }
- }
-
- return false;
- }
+// public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
+// {
+// lock (m_agentHandlers)
+// {
+// IHttpAgentHandler foundHandler;
+//
+// if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
+// {
+// m_agentHandlers.Remove(agent);
+// return true;
+// }
+// }
+//
+// return false;
+// }
public void RemoveXmlRPCHandler(string method)
{
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
index db58f6f..0bd3aae 100644
--- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs
@@ -41,10 +41,10 @@ namespace OpenSim.Framework.Servers.HttpServer
uint Port { get; }
bool UseSSL { get; }
- // Note that the agent string is provided simply to differentiate
- // the handlers - it is NOT required to be an actual agent header
- // value.
- bool AddAgentHandler(string agent, IHttpAgentHandler handler);
+// // Note that the agent string is provided simply to differentiate
+// // the handlers - it is NOT required to be an actual agent header
+// // value.
+// bool AddAgentHandler(string agent, IHttpAgentHandler handler);
///
/// Add a handler for an HTTP request.
@@ -106,13 +106,13 @@ namespace OpenSim.Framework.Servers.HttpServer
bool SetDefaultLLSDHandler(DefaultLLSDMethod handler);
- ///
- /// Remove the agent if it is registered.
- ///
- ///
- ///
- ///
- bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
+// ///
+// /// Remove the agent if it is registered.
+// ///
+// ///
+// ///
+// ///
+// bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
///
/// Remove an HTTP handler
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index 72f9cce..4b61b18 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -231,9 +231,9 @@ namespace OpenSim.Framework.Servers
foreach (String s in httpServer.GetHTTPHandlerKeys())
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
- handlers.AppendFormat("* Agent:\n");
- foreach (String s in httpServer.GetAgentHandlerKeys())
- handlers.AppendFormat("\t{0}\n", s);
+// handlers.AppendFormat("* Agent:\n");
+// foreach (String s in httpServer.GetAgentHandlerKeys())
+// handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* LLSD:\n");
foreach (String s in httpServer.GetLLSDHandlerKeys())
--
cgit v1.1
From bceef401fa9f7b9d56c5d1173ca5204aead0a57c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 21 Sep 2012 01:36:23 +0100
Subject: Simplify UuidGatherer by performing asset fetch synchronously rather
than using the async call but waiting for completion anyway!
---
OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 84 +++++++++++++------------
1 file changed, 44 insertions(+), 40 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index efb68a2..af99090 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -57,17 +57,17 @@ namespace OpenSim.Region.Framework.Scenes
/// Asset cache used for gathering assets
///
protected IAssetService m_assetCache;
-
- ///
- /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
- /// asset was found by the asset service.
- ///
- private AssetBase m_requestedObjectAsset;
- ///
- /// Signal whether we are currently waiting for the asset service to deliver an asset.
- ///
- private bool m_waitingForObjectAsset;
+// ///
+// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
+// /// asset was found by the asset service.
+// ///
+// private AssetBase m_requestedObjectAsset;
+//
+// ///
+// /// Signal whether we are currently waiting for the asset service to deliver an asset.
+// ///
+// private bool m_waitingForObjectAsset;
public UuidGatherer(IAssetService assetCache)
{
@@ -195,18 +195,18 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- ///
- /// The callback made when we request the asset for an object from the asset service.
- ///
- private void AssetReceived(string id, Object sender, AssetBase asset)
- {
- lock (this)
- {
- m_requestedObjectAsset = asset;
- m_waitingForObjectAsset = false;
- Monitor.Pulse(this);
- }
- }
+// ///
+// /// The callback made when we request the asset for an object from the asset service.
+// ///
+// private void AssetReceived(string id, Object sender, AssetBase asset)
+// {
+// lock (this)
+// {
+// m_requestedObjectAsset = asset;
+// m_waitingForObjectAsset = false;
+// Monitor.Pulse(this);
+// }
+// }
///
/// Get an asset synchronously, potentially using an asynchronous callback. If the
@@ -216,25 +216,29 @@ namespace OpenSim.Region.Framework.Scenes
///
protected virtual AssetBase GetAsset(UUID uuid)
{
- m_waitingForObjectAsset = true;
- m_assetCache.Get(uuid.ToString(), this, AssetReceived);
-
- // The asset cache callback can either
- //
- // 1. Complete on the same thread (if the asset is already in the cache) or
- // 2. Come in via a different thread (if we need to go fetch it).
- //
- // The code below handles both these alternatives.
- lock (this)
- {
- if (m_waitingForObjectAsset)
- {
- Monitor.Wait(this);
- m_waitingForObjectAsset = false;
- }
- }
+ return m_assetCache.Get(uuid.ToString());
- return m_requestedObjectAsset;
+ // XXX: Switching to do this synchronously where the call was async before but we always waited for it
+ // to complete anyway!
+// m_waitingForObjectAsset = true;
+// m_assetCache.Get(uuid.ToString(), this, AssetReceived);
+//
+// // The asset cache callback can either
+// //
+// // 1. Complete on the same thread (if the asset is already in the cache) or
+// // 2. Come in via a different thread (if we need to go fetch it).
+// //
+// // The code below handles both these alternatives.
+// lock (this)
+// {
+// if (m_waitingForObjectAsset)
+// {
+// Monitor.Wait(this);
+// m_waitingForObjectAsset = false;
+// }
+// }
+//
+// return m_requestedObjectAsset;
}
///
--
cgit v1.1
From 632a42e2b1e9a649be812ed57de1189778a370c9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 21 Sep 2012 01:57:13 +0100
Subject: Rename UuidGather.m_assetCache to m_assetService. If HGUuidGatherer
hasn't been instantiated with an assetServerURL then call down to overriden
UuidGatherer.GetAsset() instead of calling m_assetService.GetAsset() itself -
these two codepaths are now identical.
---
.../CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs | 4 ++--
OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 11 ++++-------
2 files changed, 6 insertions(+), 9 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs
index fcb544f..c7e1ef4 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected string m_assetServerURL;
protected HGAssetMapper m_assetMapper;
- public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetCache, string assetServerURL) : base(assetCache)
+ public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetService, string assetServerURL) : base(assetService)
{
m_assetMapper = assMap;
m_assetServerURL = assetServerURL;
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected override AssetBase GetAsset(UUID uuid)
{
if (string.Empty == m_assetServerURL)
- return m_assetCache.Get(uuid.ToString());
+ return base.GetAsset(uuid);
else
return m_assetMapper.FetchAsset(m_assetServerURL, uuid);
}
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index af99090..dc4a082 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -52,11 +52,8 @@ namespace OpenSim.Region.Framework.Scenes
public class UuidGatherer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- ///
- /// Asset cache used for gathering assets
- ///
- protected IAssetService m_assetCache;
+
+ protected IAssetService m_assetService;
// ///
// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
@@ -71,7 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
public UuidGatherer(IAssetService assetCache)
{
- m_assetCache = assetCache;
+ m_assetService = assetCache;
}
///
@@ -216,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
///
protected virtual AssetBase GetAsset(UUID uuid)
{
- return m_assetCache.Get(uuid.ToString());
+ return m_assetService.Get(uuid.ToString());
// XXX: Switching to do this synchronously where the call was async before but we always waited for it
// to complete anyway!
--
cgit v1.1
From 80f486c7782e195d8cf3eb11adaca66f6e648af1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 21 Sep 2012 01:59:28 +0100
Subject: minor: Make slow outgoing request log messages consistent with other
log messages
---
OpenSim/Framework/WebUtil.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index e095402..1d9e2ce 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -241,7 +241,7 @@ namespace OpenSim.Framework
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > LongCallTime)
m_log.InfoFormat(
- "[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
+ "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
method,
url,
@@ -257,7 +257,7 @@ namespace OpenSim.Framework
}
m_log.DebugFormat(
- "[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
+ "[WEB UTIL]: ServiceOSD request {0} {1} {2} FAILED: {3}", reqnum, url, method, errorMessage);
return ErrorResponseMap(errorMessage);
}
@@ -400,7 +400,7 @@ namespace OpenSim.Framework
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > LongCallTime)
m_log.InfoFormat(
- "[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
+ "[WEB UTIL]: Slow ServiceForm request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
method,
url,
@@ -415,7 +415,7 @@ namespace OpenSim.Framework
reqnum, tickdiff, tickdata);
}
- m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
+ m_log.WarnFormat("[WEB UTIL]: ServiceForm request {0} {1} {2} failed: {2}", reqnum, method, url, errorMessage);
return ErrorResponseMap(errorMessage);
}
@@ -879,7 +879,7 @@ namespace OpenSim.Framework
}
m_log.InfoFormat(
- "[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
+ "[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
verb,
requestUrl,
@@ -1002,7 +1002,7 @@ namespace OpenSim.Framework
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > WebUtil.LongCallTime)
m_log.InfoFormat(
- "[FORMS]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
+ "[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
verb,
requestUrl,
@@ -1154,7 +1154,7 @@ namespace OpenSim.Framework
}
m_log.InfoFormat(
- "[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
+ "[SynchronousRestObjectRequester]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
verb,
requestUrl,
--
cgit v1.1