aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs30
-rw-r--r--OpenSim/ApplicationPlugins/Rest/RestPlugin.cs14
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs205
-rw-r--r--OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs22
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs6
-rw-r--r--OpenSim/Framework/WebUtil.cs16
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs93
8 files changed, 210 insertions, 180 deletions
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
312 // Now that everything is setup we can proceed to 312 // Now that everything is setup we can proceed to
313 // add THIS agent to the HTTP server's handler list 313 // add THIS agent to the HTTP server's handler list
314 314
315 if (!AddAgentHandler(Rest.Name,this)) 315 // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
316 { 316 // have to be handled through the AddHttpHandler interface.
317 Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId); 317// if (!AddAgentHandler(Rest.Name,this))
318 foreach (IRest handler in handlers) 318// {
319 { 319// Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
320 handler.Close(); 320// foreach (IRest handler in handlers)
321 } 321// {
322 } 322// handler.Close();
323// }
324// }
323 325
324 } 326 }
325 catch (Exception e) 327 catch (Exception e)
@@ -342,11 +344,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
342 { 344 {
343 Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId); 345 Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
344 346
345 try 347 // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
346 { 348 // have to be handled through the AddHttpHandler interface.
347 RemoveAgentHandler(Rest.Name, this); 349// try
348 } 350// {
349 catch (KeyNotFoundException){} 351// RemoveAgentHandler(Rest.Name, this);
352// }
353// catch (KeyNotFoundException){}
350 354
351 foreach (IRest handler in handlers) 355 foreach (IRest handler in handlers)
352 { 356 {
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
297 { 297 {
298 if (!IsEnabled) return false; 298 if (!IsEnabled) return false;
299 _agents.Add(agentName, handler); 299 _agents.Add(agentName, handler);
300 return _httpd.AddAgentHandler(agentName, handler); 300// return _httpd.AddAgentHandler(agentName, handler);
301
302 return false;
301 } 303 }
302 304
303 /// <summary> 305 /// <summary>
@@ -316,7 +318,7 @@ namespace OpenSim.ApplicationPlugins.Rest
316 if (_agents[agentName] == handler) 318 if (_agents[agentName] == handler)
317 { 319 {
318 _agents.Remove(agentName); 320 _agents.Remove(agentName);
319 return _httpd.RemoveAgentHandler(agentName, handler); 321// return _httpd.RemoveAgentHandler(agentName, handler);
320 } 322 }
321 return false; 323 return false;
322 } 324 }
@@ -358,10 +360,10 @@ namespace OpenSim.ApplicationPlugins.Rest
358 _httpd.RemoveStreamHandler(h.HttpMethod, h.Path); 360 _httpd.RemoveStreamHandler(h.HttpMethod, h.Path);
359 } 361 }
360 _handlers = null; 362 _handlers = null;
361 foreach (KeyValuePair<string, IHttpAgentHandler> h in _agents) 363// foreach (KeyValuePair<string, IHttpAgentHandler> h in _agents)
362 { 364// {
363 _httpd.RemoveAgentHandler(h.Key, h.Value); 365// _httpd.RemoveAgentHandler(h.Key, h.Value);
364 } 366// }
365 _agents = null; 367 _agents = null;
366 } 368 }
367 369
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 4e04dd8..8c29ad4 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -62,6 +62,15 @@ namespace OpenSim.Framework.Servers.HttpServer
62 /// </value> 62 /// </value>
63 public int DebugLevel { get; set; } 63 public int DebugLevel { get; set; }
64 64
65 /// <summary>
66 /// Request number for diagnostic purposes.
67 /// </summary>
68 /// <remarks>
69 /// This is an internal number. In some debug situations an external number may also be supplied in the
70 /// opensim-request-id header but we are not currently logging this.
71 /// </remarks>
72 public int RequestNumber { get; private set; }
73
65 private volatile int NotSocketErrors = 0; 74 private volatile int NotSocketErrors = 0;
66 public volatile bool HTTPDRunning = false; 75 public volatile bool HTTPDRunning = false;
67 76
@@ -73,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer
73 protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>(); 82 protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>();
74 protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>(); 83 protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
75 protected Dictionary<string, GenericHTTPMethod> m_HTTPHandlers = new Dictionary<string, GenericHTTPMethod>(); 84 protected Dictionary<string, GenericHTTPMethod> m_HTTPHandlers = new Dictionary<string, GenericHTTPMethod>();
76 protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>(); 85// protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>();
77 protected Dictionary<string, PollServiceEventArgs> m_pollHandlers = 86 protected Dictionary<string, PollServiceEventArgs> m_pollHandlers =
78 new Dictionary<string, PollServiceEventArgs>(); 87 new Dictionary<string, PollServiceEventArgs>();
79 88
@@ -251,29 +260,29 @@ namespace OpenSim.Framework.Servers.HttpServer
251 return new List<string>(m_pollHandlers.Keys); 260 return new List<string>(m_pollHandlers.Keys);
252 } 261 }
253 262
254 // Note that the agent string is provided simply to differentiate 263// // Note that the agent string is provided simply to differentiate
255 // the handlers - it is NOT required to be an actual agent header 264// // the handlers - it is NOT required to be an actual agent header
256 // value. 265// // value.
257 public bool AddAgentHandler(string agent, IHttpAgentHandler handler) 266// public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
258 { 267// {
259 lock (m_agentHandlers) 268// lock (m_agentHandlers)
260 { 269// {
261 if (!m_agentHandlers.ContainsKey(agent)) 270// if (!m_agentHandlers.ContainsKey(agent))
262 { 271// {
263 m_agentHandlers.Add(agent, handler); 272// m_agentHandlers.Add(agent, handler);
264 return true; 273// return true;
265 } 274// }
266 } 275// }
267 276//
268 //must already have a handler for that path so return false 277// //must already have a handler for that path so return false
269 return false; 278// return false;
270 } 279// }
271 280//
272 public List<string> GetAgentHandlerKeys() 281// public List<string> GetAgentHandlerKeys()
273 { 282// {
274 lock (m_agentHandlers) 283// lock (m_agentHandlers)
275 return new List<string>(m_agentHandlers.Keys); 284// return new List<string>(m_agentHandlers.Keys);
276 } 285// }
277 286
278 public bool AddLLSDHandler(string path, LLSDMethod handler) 287 public bool AddLLSDHandler(string path, LLSDMethod handler)
279 { 288 {
@@ -302,6 +311,8 @@ namespace OpenSim.Framework.Servers.HttpServer
302 311
303 private void OnRequest(object source, RequestEventArgs args) 312 private void OnRequest(object source, RequestEventArgs args)
304 { 313 {
314 RequestNumber++;
315
305 try 316 try
306 { 317 {
307 IHttpClientContext context = (IHttpClientContext)source; 318 IHttpClientContext context = (IHttpClientContext)source;
@@ -411,7 +422,6 @@ namespace OpenSim.Framework.Servers.HttpServer
411 string requestMethod = request.HttpMethod; 422 string requestMethod = request.HttpMethod;
412 string uriString = request.RawUrl; 423 string uriString = request.RawUrl;
413 424
414// string reqnum = "unknown";
415 int requestStartTick = Environment.TickCount; 425 int requestStartTick = Environment.TickCount;
416 426
417 // Will be adjusted later on. 427 // Will be adjusted later on.
@@ -428,22 +438,22 @@ namespace OpenSim.Framework.Servers.HttpServer
428 438
429 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 439 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
430 440
431 // This is the REST agent interface. We require an agent to properly identify 441// // This is the REST agent interface. We require an agent to properly identify
432 // itself. If the REST handler recognizes the prefix it will attempt to 442// // itself. If the REST handler recognizes the prefix it will attempt to
433 // satisfy the request. If it is not recognizable, and no damage has occurred 443// // satisfy the request. If it is not recognizable, and no damage has occurred
434 // the request can be passed through to the other handlers. This is a low 444// // the request can be passed through to the other handlers. This is a low
435 // probability event; if a request is matched it is normally expected to be 445// // probability event; if a request is matched it is normally expected to be
436 // handled 446// // handled
437 IHttpAgentHandler agentHandler; 447// IHttpAgentHandler agentHandler;
438 448//
439 if (TryGetAgentHandler(request, response, out agentHandler)) 449// if (TryGetAgentHandler(request, response, out agentHandler))
440 { 450// {
441 if (HandleAgentRequest(agentHandler, request, response)) 451// if (HandleAgentRequest(agentHandler, request, response))
442 { 452// {
443 requestEndTick = Environment.TickCount; 453// requestEndTick = Environment.TickCount;
444 return; 454// return;
445 } 455// }
446 } 456// }
447 457
448 //response.KeepAlive = true; 458 //response.KeepAlive = true;
449 response.SendChunked = false; 459 response.SendChunked = false;
@@ -535,8 +545,8 @@ namespace OpenSim.Framework.Servers.HttpServer
535 545
536 if (DebugLevel >= 3) 546 if (DebugLevel >= 3)
537 m_log.DebugFormat( 547 m_log.DebugFormat(
538 "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", 548 "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
539 request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); 549 RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
540 550
541 buffer = HandleHTTPRequest(request, response); 551 buffer = HandleHTTPRequest(request, response);
542 break; 552 break;
@@ -547,8 +557,8 @@ namespace OpenSim.Framework.Servers.HttpServer
547 557
548 if (DebugLevel >= 3) 558 if (DebugLevel >= 3)
549 m_log.DebugFormat( 559 m_log.DebugFormat(
550 "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", 560 "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
551 request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); 561 RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint);
552 562
553 buffer = HandleLLSDRequests(request, response); 563 buffer = HandleLLSDRequests(request, response);
554 break; 564 break;
@@ -641,7 +651,8 @@ namespace OpenSim.Framework.Servers.HttpServer
641 if (tickdiff > 3000) 651 if (tickdiff > 3000)
642 { 652 {
643 m_log.InfoFormat( 653 m_log.InfoFormat(
644 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms", 654 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
655 RequestNumber,
645 requestMethod, 656 requestMethod,
646 uriString, 657 uriString,
647 requestHandler != null ? requestHandler.Name : "", 658 requestHandler != null ? requestHandler.Name : "",
@@ -652,12 +663,9 @@ namespace OpenSim.Framework.Servers.HttpServer
652 else if (DebugLevel >= 4) 663 else if (DebugLevel >= 4)
653 { 664 {
654 m_log.DebugFormat( 665 m_log.DebugFormat(
655 "[BASE HTTP SERVER]: HTTP IN {0} {1} {2} {3} from {4} took {5}ms", 666 "[BASE HTTP SERVER]: HTTP IN {0} :{1} took {2}ms",
656 requestMethod, 667 RequestNumber,
657 uriString, 668 Port,
658 requestHandler != null ? requestHandler.Name : "",
659 requestHandler != null ? requestHandler.Description : "",
660 request.RemoteIPEndPoint,
661 tickdiff); 669 tickdiff);
662 } 670 }
663 } 671 }
@@ -666,8 +674,14 @@ namespace OpenSim.Framework.Servers.HttpServer
666 private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler) 674 private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler)
667 { 675 {
668 m_log.DebugFormat( 676 m_log.DebugFormat(
669 "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3} from {4}", 677 "[BASE HTTP SERVER]: HTTP IN {0} :{1} stream handler {2} {3} {4} {5} from {6}",
670 request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description, request.RemoteIPEndPoint); 678 RequestNumber,
679 Port,
680 request.HttpMethod,
681 request.Url.PathAndQuery,
682 requestHandler.Name,
683 requestHandler.Description,
684 request.RemoteIPEndPoint);
671 685
672 if (DebugLevel >= 5) 686 if (DebugLevel >= 5)
673 LogIncomingInDetail(request); 687 LogIncomingInDetail(request);
@@ -676,8 +690,13 @@ namespace OpenSim.Framework.Servers.HttpServer
676 private void LogIncomingToContentTypeHandler(OSHttpRequest request) 690 private void LogIncomingToContentTypeHandler(OSHttpRequest request)
677 { 691 {
678 m_log.DebugFormat( 692 m_log.DebugFormat(
679 "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", 693 "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
680 request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); 694 RequestNumber,
695 Port,
696 request.ContentType,
697 request.HttpMethod,
698 request.Url.PathAndQuery,
699 request.RemoteIPEndPoint);
681 700
682 if (DebugLevel >= 5) 701 if (DebugLevel >= 5)
683 LogIncomingInDetail(request); 702 LogIncomingInDetail(request);
@@ -686,8 +705,12 @@ namespace OpenSim.Framework.Servers.HttpServer
686 private void LogIncomingToXmlRpcHandler(OSHttpRequest request) 705 private void LogIncomingToXmlRpcHandler(OSHttpRequest request)
687 { 706 {
688 m_log.DebugFormat( 707 m_log.DebugFormat(
689 "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1} from {2}", 708 "[BASE HTTP SERVER]: HTTP IN {0} :{1} assumed generic XMLRPC request {2} {3} from {4}",
690 request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); 709 RequestNumber,
710 Port,
711 request.HttpMethod,
712 request.Url.PathAndQuery,
713 request.RemoteIPEndPoint);
691 714
692 if (DebugLevel >= 5) 715 if (DebugLevel >= 5)
693 LogIncomingInDetail(request); 716 LogIncomingInDetail(request);
@@ -807,24 +830,24 @@ namespace OpenSim.Framework.Servers.HttpServer
807 } 830 }
808 } 831 }
809 832
810 private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) 833// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
811 { 834// {
812 agentHandler = null; 835// agentHandler = null;
813 836//
814 lock (m_agentHandlers) 837// lock (m_agentHandlers)
815 { 838// {
816 foreach (IHttpAgentHandler handler in m_agentHandlers.Values) 839// foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
817 { 840// {
818 if (handler.Match(request, response)) 841// if (handler.Match(request, response))
819 { 842// {
820 agentHandler = handler; 843// agentHandler = handler;
821 return true; 844// return true;
822 } 845// }
823 } 846// }
824 } 847// }
825 848//
826 return false; 849// return false;
827 } 850// }
828 851
829 /// <summary> 852 /// <summary>
830 /// Try all the registered xmlrpc handlers when an xmlrpc request is received. 853 /// Try all the registered xmlrpc handlers when an xmlrpc request is received.
@@ -1749,21 +1772,21 @@ namespace OpenSim.Framework.Servers.HttpServer
1749 m_pollHandlers.Remove(path); 1772 m_pollHandlers.Remove(path);
1750 } 1773 }
1751 1774
1752 public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) 1775// public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
1753 { 1776// {
1754 lock (m_agentHandlers) 1777// lock (m_agentHandlers)
1755 { 1778// {
1756 IHttpAgentHandler foundHandler; 1779// IHttpAgentHandler foundHandler;
1757 1780//
1758 if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler) 1781// if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
1759 { 1782// {
1760 m_agentHandlers.Remove(agent); 1783// m_agentHandlers.Remove(agent);
1761 return true; 1784// return true;
1762 } 1785// }
1763 } 1786// }
1764 1787//
1765 return false; 1788// return false;
1766 } 1789// }
1767 1790
1768 public void RemoveXmlRPCHandler(string method) 1791 public void RemoveXmlRPCHandler(string method)
1769 { 1792 {
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
41 uint Port { get; } 41 uint Port { get; }
42 bool UseSSL { get; } 42 bool UseSSL { get; }
43 43
44 // Note that the agent string is provided simply to differentiate 44// // Note that the agent string is provided simply to differentiate
45 // the handlers - it is NOT required to be an actual agent header 45// // the handlers - it is NOT required to be an actual agent header
46 // value. 46// // value.
47 bool AddAgentHandler(string agent, IHttpAgentHandler handler); 47// bool AddAgentHandler(string agent, IHttpAgentHandler handler);
48 48
49 /// <summary> 49 /// <summary>
50 /// Add a handler for an HTTP request. 50 /// Add a handler for an HTTP request.
@@ -106,13 +106,13 @@ namespace OpenSim.Framework.Servers.HttpServer
106 106
107 bool SetDefaultLLSDHandler(DefaultLLSDMethod handler); 107 bool SetDefaultLLSDHandler(DefaultLLSDMethod handler);
108 108
109 /// <summary> 109// /// <summary>
110 /// Remove the agent if it is registered. 110// /// Remove the agent if it is registered.
111 /// </summary> 111// /// </summary>
112 /// <param name="agent"></param> 112// /// <param name="agent"></param>
113 /// <param name="handler"></param> 113// /// <param name="handler"></param>
114 /// <returns></returns> 114// /// <returns></returns>
115 bool RemoveAgentHandler(string agent, IHttpAgentHandler handler); 115// bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
116 116
117 /// <summary> 117 /// <summary>
118 /// Remove an HTTP handler 118 /// 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
231 foreach (String s in httpServer.GetHTTPHandlerKeys()) 231 foreach (String s in httpServer.GetHTTPHandlerKeys())
232 handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); 232 handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
233 233
234 handlers.AppendFormat("* Agent:\n"); 234// handlers.AppendFormat("* Agent:\n");
235 foreach (String s in httpServer.GetAgentHandlerKeys()) 235// foreach (String s in httpServer.GetAgentHandlerKeys())
236 handlers.AppendFormat("\t{0}\n", s); 236// handlers.AppendFormat("\t{0}\n", s);
237 237
238 handlers.AppendFormat("* LLSD:\n"); 238 handlers.AppendFormat("* LLSD:\n");
239 foreach (String s in httpServer.GetLLSDHandlerKeys()) 239 foreach (String s in httpServer.GetLLSDHandlerKeys())
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 64d61f1..1d9e2ce 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Framework
64 /// <summary> 64 /// <summary>
65 /// Request number for diagnostic purposes. 65 /// Request number for diagnostic purposes.
66 /// </summary> 66 /// </summary>
67 public static int RequestNumber = 0; 67 public static int RequestNumber { get; internal set; }
68 68
69 /// <summary> 69 /// <summary>
70 /// this is the header field used to communicate the local request id 70 /// this is the header field used to communicate the local request id
@@ -241,7 +241,7 @@ namespace OpenSim.Framework
241 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 241 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
242 if (tickdiff > LongCallTime) 242 if (tickdiff > LongCallTime)
243 m_log.InfoFormat( 243 m_log.InfoFormat(
244 "[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", 244 "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
245 reqnum, 245 reqnum,
246 method, 246 method,
247 url, 247 url,
@@ -257,7 +257,7 @@ namespace OpenSim.Framework
257 } 257 }
258 258
259 m_log.DebugFormat( 259 m_log.DebugFormat(
260 "[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage); 260 "[WEB UTIL]: ServiceOSD request {0} {1} {2} FAILED: {3}", reqnum, url, method, errorMessage);
261 261
262 return ErrorResponseMap(errorMessage); 262 return ErrorResponseMap(errorMessage);
263 } 263 }
@@ -400,7 +400,7 @@ namespace OpenSim.Framework
400 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 400 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
401 if (tickdiff > LongCallTime) 401 if (tickdiff > LongCallTime)
402 m_log.InfoFormat( 402 m_log.InfoFormat(
403 "[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", 403 "[WEB UTIL]: Slow ServiceForm request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
404 reqnum, 404 reqnum,
405 method, 405 method,
406 url, 406 url,
@@ -415,7 +415,7 @@ namespace OpenSim.Framework
415 reqnum, tickdiff, tickdata); 415 reqnum, tickdiff, tickdata);
416 } 416 }
417 417
418 m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); 418 m_log.WarnFormat("[WEB UTIL]: ServiceForm request {0} {1} {2} failed: {2}", reqnum, method, url, errorMessage);
419 419
420 return ErrorResponseMap(errorMessage); 420 return ErrorResponseMap(errorMessage);
421 } 421 }
@@ -879,7 +879,7 @@ namespace OpenSim.Framework
879 } 879 }
880 880
881 m_log.InfoFormat( 881 m_log.InfoFormat(
882 "[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", 882 "[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
883 reqnum, 883 reqnum,
884 verb, 884 verb,
885 requestUrl, 885 requestUrl,
@@ -1002,7 +1002,7 @@ namespace OpenSim.Framework
1002 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 1002 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
1003 if (tickdiff > WebUtil.LongCallTime) 1003 if (tickdiff > WebUtil.LongCallTime)
1004 m_log.InfoFormat( 1004 m_log.InfoFormat(
1005 "[FORMS]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", 1005 "[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
1006 reqnum, 1006 reqnum,
1007 verb, 1007 verb,
1008 requestUrl, 1008 requestUrl,
@@ -1154,7 +1154,7 @@ namespace OpenSim.Framework
1154 } 1154 }
1155 1155
1156 m_log.InfoFormat( 1156 m_log.InfoFormat(
1157 "[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", 1157 "[SynchronousRestObjectRequester]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
1158 reqnum, 1158 reqnum,
1159 verb, 1159 verb,
1160 requestUrl, 1160 requestUrl,
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
40 protected string m_assetServerURL; 40 protected string m_assetServerURL;
41 protected HGAssetMapper m_assetMapper; 41 protected HGAssetMapper m_assetMapper;
42 42
43 public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetCache, string assetServerURL) : base(assetCache) 43 public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetService, string assetServerURL) : base(assetService)
44 { 44 {
45 m_assetMapper = assMap; 45 m_assetMapper = assMap;
46 m_assetServerURL = assetServerURL; 46 m_assetServerURL = assetServerURL;
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
49 protected override AssetBase GetAsset(UUID uuid) 49 protected override AssetBase GetAsset(UUID uuid)
50 { 50 {
51 if (string.Empty == m_assetServerURL) 51 if (string.Empty == m_assetServerURL)
52 return m_assetCache.Get(uuid.ToString()); 52 return base.GetAsset(uuid);
53 else 53 else
54 return m_assetMapper.FetchAsset(m_assetServerURL, uuid); 54 return m_assetMapper.FetchAsset(m_assetServerURL, uuid);
55 } 55 }
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index efb68a2..dc4a082 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -52,26 +52,23 @@ namespace OpenSim.Region.Framework.Scenes
52 public class UuidGatherer 52 public class UuidGatherer
53 { 53 {
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55
56 /// <summary>
57 /// Asset cache used for gathering assets
58 /// </summary>
59 protected IAssetService m_assetCache;
60
61 /// <summary>
62 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
63 /// asset was found by the asset service.
64 /// </summary>
65 private AssetBase m_requestedObjectAsset;
66 55
67 /// <summary> 56 protected IAssetService m_assetService;
68 /// Signal whether we are currently waiting for the asset service to deliver an asset. 57
69 /// </summary> 58// /// <summary>
70 private bool m_waitingForObjectAsset; 59// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
60// /// asset was found by the asset service.
61// /// </summary>
62// private AssetBase m_requestedObjectAsset;
63//
64// /// <summary>
65// /// Signal whether we are currently waiting for the asset service to deliver an asset.
66// /// </summary>
67// private bool m_waitingForObjectAsset;
71 68
72 public UuidGatherer(IAssetService assetCache) 69 public UuidGatherer(IAssetService assetCache)
73 { 70 {
74 m_assetCache = assetCache; 71 m_assetService = assetCache;
75 } 72 }
76 73
77 /// <summary> 74 /// <summary>
@@ -195,18 +192,18 @@ namespace OpenSim.Region.Framework.Scenes
195 } 192 }
196 } 193 }
197 194
198 /// <summary> 195// /// <summary>
199 /// The callback made when we request the asset for an object from the asset service. 196// /// The callback made when we request the asset for an object from the asset service.
200 /// </summary> 197// /// </summary>
201 private void AssetReceived(string id, Object sender, AssetBase asset) 198// private void AssetReceived(string id, Object sender, AssetBase asset)
202 { 199// {
203 lock (this) 200// lock (this)
204 { 201// {
205 m_requestedObjectAsset = asset; 202// m_requestedObjectAsset = asset;
206 m_waitingForObjectAsset = false; 203// m_waitingForObjectAsset = false;
207 Monitor.Pulse(this); 204// Monitor.Pulse(this);
208 } 205// }
209 } 206// }
210 207
211 /// <summary> 208 /// <summary>
212 /// Get an asset synchronously, potentially using an asynchronous callback. If the 209 /// Get an asset synchronously, potentially using an asynchronous callback. If the
@@ -216,25 +213,29 @@ namespace OpenSim.Region.Framework.Scenes
216 /// <returns></returns> 213 /// <returns></returns>
217 protected virtual AssetBase GetAsset(UUID uuid) 214 protected virtual AssetBase GetAsset(UUID uuid)
218 { 215 {
219 m_waitingForObjectAsset = true; 216 return m_assetService.Get(uuid.ToString());
220 m_assetCache.Get(uuid.ToString(), this, AssetReceived);
221
222 // The asset cache callback can either
223 //
224 // 1. Complete on the same thread (if the asset is already in the cache) or
225 // 2. Come in via a different thread (if we need to go fetch it).
226 //
227 // The code below handles both these alternatives.
228 lock (this)
229 {
230 if (m_waitingForObjectAsset)
231 {
232 Monitor.Wait(this);
233 m_waitingForObjectAsset = false;
234 }
235 }
236 217
237 return m_requestedObjectAsset; 218 // XXX: Switching to do this synchronously where the call was async before but we always waited for it
219 // to complete anyway!
220// m_waitingForObjectAsset = true;
221// m_assetCache.Get(uuid.ToString(), this, AssetReceived);
222//
223// // The asset cache callback can either
224// //
225// // 1. Complete on the same thread (if the asset is already in the cache) or
226// // 2. Come in via a different thread (if we need to go fetch it).
227// //
228// // The code below handles both these alternatives.
229// lock (this)
230// {
231// if (m_waitingForObjectAsset)
232// {
233// Monitor.Wait(this);
234// m_waitingForObjectAsset = false;
235// }
236// }
237//
238// return m_requestedObjectAsset;
238 } 239 }
239 240
240 /// <summary> 241 /// <summary>