aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs3
-rw-r--r--OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs15
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs4
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs6
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs2
-rw-r--r--OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs4
-rw-r--r--OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs8
-rw-r--r--OpenSim/Capabilities/LLSDStreamHandler.cs6
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHTTPHandler.cs10
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs16
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs10
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs9
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs17
-rw-r--r--OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs21
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs6
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestHTTPHandler.cs20
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs14
-rw-r--r--OpenSim/Framework/TaskInventoryItem.cs16
-rw-r--r--OpenSim/Framework/WebUtil.cs277
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs48
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs8
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs93
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs14
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs15
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs33
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs17
-rw-r--r--OpenSim/Region/DataSnapshot/DataRequestHandler.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs69
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs53
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs54
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs17
-rw-r--r--OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs2
-rw-r--r--OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs4
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs2
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs3
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs20
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs43
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs17
57 files changed, 780 insertions, 357 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs
index 0ba8931..5bab52f 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2ServerConnector.cs
@@ -63,7 +63,8 @@ namespace OpenSim.Capabilities.Handlers
63 63
64 FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService); 64 FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
65 IRequestHandler reqHandler 65 IRequestHandler reqHandler
66 = new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest); 66 = new RestStreamHandler(
67 "POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null);
67 server.AddStreamHandler(reqHandler); 68 server.AddStreamHandler(reqHandler);
68 } 69 }
69 } 70 }
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs
index 2ecfa3c..8a275f3 100644
--- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshServerConnector.cs
@@ -66,13 +66,14 @@ namespace OpenSim.Capabilities.Handlers
66 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); 66 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
67 67
68 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); 68 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
69 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), 69 IRequestHandler reqHandler
70 delegate(Hashtable m_dhttpMethod) 70 = new RestHTTPHandler(
71 { 71 "GET",
72 return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); 72 "/CAPS/" + UUID.Random(),
73 }); 73 httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
74 "GetMesh",
75 null);
74 server.AddStreamHandler(reqHandler); 76 server.AddStreamHandler(reqHandler);
75 } 77 }
76
77 } 78 }
78} 79} \ No newline at end of file
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 217217e..abdbc72 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -58,8 +58,8 @@ namespace OpenSim.Capabilities.Handlers
58 // TODO: Change this to a config option 58 // TODO: Change this to a config option
59 const string REDIRECT_URL = null; 59 const string REDIRECT_URL = null;
60 60
61 public GetTextureHandler(string path, IAssetService assService) : 61 public GetTextureHandler(string path, IAssetService assService, string name, string description)
62 base("GET", path) 62 : base("GET", path, name, description)
63 { 63 {
64 m_assetService = assService; 64 m_assetService = assService;
65 } 65 }
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
index 0d072f7..71cf033 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
@@ -62,8 +62,8 @@ namespace OpenSim.Capabilities.Handlers
62 if (m_AssetService == null) 62 if (m_AssetService == null)
63 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); 63 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
64 64
65 server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService)); 65 server.AddStreamHandler(
66 new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null));
66 } 67 }
67
68 } 68 }
69} 69} \ No newline at end of file
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index 85e5cc6..761e4e7 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
52 // Overkill - we only really need the asset service, not a whole scene. 52 // Overkill - we only really need the asset service, not a whole scene.
53 Scene scene = new SceneHelpers().SetupScene(); 53 Scene scene = new SceneHelpers().SetupScene();
54 54
55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); 55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null);
56 TestOSHttpRequest req = new TestOSHttpRequest(); 56 TestOSHttpRequest req = new TestOSHttpRequest();
57 TestOSHttpResponse resp = new TestOSHttpResponse(); 57 TestOSHttpResponse resp = new TestOSHttpResponse();
58 req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); 58 req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012");
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
index 594ce9d..8849a59 100644
--- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
@@ -85,8 +85,8 @@ namespace OpenSim.Capabilities.Handlers
85 uploader.OnUpLoad += BakedTextureUploaded; 85 uploader.OnUpLoad += BakedTextureUploaded;
86 86
87 m_HostCapsObj.HttpListener.AddStreamHandler( 87 m_HostCapsObj.HttpListener.AddStreamHandler(
88 new BinaryStreamHandler("POST", capsBase + uploaderPath, 88 new BinaryStreamHandler(
89 uploader.uploaderCaps)); 89 "POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null));
90 90
91 string protocol = "http://"; 91 string protocol = "http://";
92 92
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs
index 92eeb14..5d86557 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescServerConnector.cs
@@ -68,7 +68,13 @@ namespace OpenSim.Capabilities.Handlers
68 ServerUtils.LoadPlugin<ILibraryService>(libService, args); 68 ServerUtils.LoadPlugin<ILibraryService>(libService, args);
69 69
70 WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); 70 WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
71 IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest); 71 IRequestHandler reqHandler
72 = new RestStreamHandler(
73 "POST",
74 "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/,
75 webFetchHandler.FetchInventoryDescendentsRequest,
76 "WebFetchInvDesc",
77 null);
72 server.AddStreamHandler(reqHandler); 78 server.AddStreamHandler(reqHandler);
73 } 79 }
74 80
diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs
index c7c1fc9..f5c728c 100644
--- a/OpenSim/Capabilities/LLSDStreamHandler.cs
+++ b/OpenSim/Capabilities/LLSDStreamHandler.cs
@@ -39,7 +39,11 @@ namespace OpenSim.Framework.Capabilities
39 private LLSDMethod<TRequest, TResponse> m_method; 39 private LLSDMethod<TRequest, TResponse> m_method;
40 40
41 public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) 41 public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method)
42 : base(httpMethod, path) 42 : this(httpMethod, path, method, null, null) {}
43
44 public LLSDStreamhandler(
45 string httpMethod, string path, LLSDMethod<TRequest, TResponse> method, string name, string description)
46 : base(httpMethod, path, name, description)
43 { 47 {
44 m_method = method; 48 m_method = method;
45 } 49 }
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHTTPHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseHTTPHandler.cs
index 2fe9769..9f8f4a8 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHTTPHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHTTPHandler.cs
@@ -33,9 +33,9 @@ namespace OpenSim.Framework.Servers.HttpServer
33 { 33 {
34 public abstract Hashtable Handle(string path, Hashtable Request); 34 public abstract Hashtable Handle(string path, Hashtable Request);
35 35
36 protected BaseHTTPHandler(string httpMethod, string path) 36 protected BaseHTTPHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
37 : base(httpMethod, path) 37
38 { 38 protected BaseHTTPHandler(string httpMethod, string path, string name, string description)
39 } 39 : base(httpMethod, path, name, description) {}
40 } 40 }
41} 41} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 63b9396..dfb09f4 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer
156 } 156 }
157 } 157 }
158 158
159 public List<string> GetStreamHandlerKeys() 159 public List<string> GetStreamHandlerKeys()
160 { 160 {
161 lock (m_streamHandlers) 161 lock (m_streamHandlers)
162 return new List<string>(m_streamHandlers.Keys); 162 return new List<string>(m_streamHandlers.Keys);
@@ -410,6 +410,8 @@ namespace OpenSim.Framework.Servers.HttpServer
410// string reqnum = "unknown"; 410// string reqnum = "unknown";
411 int tickstart = Environment.TickCount; 411 int tickstart = Environment.TickCount;
412 412
413 IRequestHandler requestHandler = null;
414
413 try 415 try
414 { 416 {
415 // OpenSim.Framework.WebUtil.OSHeaderRequestID 417 // OpenSim.Framework.WebUtil.OSHeaderRequestID
@@ -438,8 +440,6 @@ namespace OpenSim.Framework.Servers.HttpServer
438 //response.KeepAlive = true; 440 //response.KeepAlive = true;
439 response.SendChunked = false; 441 response.SendChunked = false;
440 442
441 IRequestHandler requestHandler;
442
443 string path = request.RawUrl; 443 string path = request.RawUrl;
444 string handlerKey = GetHandlerKey(request.HttpMethod, path); 444 string handlerKey = GetHandlerKey(request.HttpMethod, path);
445 445
@@ -675,8 +675,16 @@ namespace OpenSim.Framework.Servers.HttpServer
675 // since its just for reporting, tickdiff limit can be adjusted 675 // since its just for reporting, tickdiff limit can be adjusted
676 int tickdiff = Environment.TickCount - tickstart; 676 int tickdiff = Environment.TickCount - tickstart;
677 if (tickdiff > 3000) 677 if (tickdiff > 3000)
678 {
678 m_log.InfoFormat( 679 m_log.InfoFormat(
679 "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff); 680 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms",
681 requestMethod,
682 uriString,
683 requestHandler != null ? requestHandler.Name : "",
684 requestHandler != null ? requestHandler.Description : "",
685 request.RemoteIPEndPoint.ToString(),
686 tickdiff);
687 }
680 } 688 }
681 } 689 }
682 690
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
index a2135a3..ae7aaf2 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs
@@ -45,8 +45,16 @@ namespace OpenSim.Framework.Servers.HttpServer
45 45
46 private readonly string m_path; 46 private readonly string m_path;
47 47
48 protected BaseRequestHandler(string httpMethod, string path) 48 public string Name { get; private set; }
49
50 public string Description { get; private set; }
51
52 protected BaseRequestHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
53
54 protected BaseRequestHandler(string httpMethod, string path, string name, string description)
49 { 55 {
56 Name = name;
57 Description = description;
50 m_httpMethod = httpMethod; 58 m_httpMethod = httpMethod;
51 m_path = path; 59 m_path = path;
52 } 60 }
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs
index f1cde74..6342983 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs
@@ -34,8 +34,9 @@ namespace OpenSim.Framework.Servers.HttpServer
34 public abstract byte[] Handle(string path, Stream request, 34 public abstract byte[] Handle(string path, Stream request,
35 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); 35 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
36 36
37 protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path) 37 protected BaseStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
38 { 38
39 } 39 protected BaseStreamHandler(string httpMethod, string path, string name, string description)
40 : base(httpMethod, path, name, description) {}
40 } 41 }
41} 42} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs
index 1699233..b94bfb4 100644
--- a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs
@@ -36,6 +36,15 @@ namespace OpenSim.Framework.Servers.HttpServer
36 { 36 {
37 private BinaryMethod m_method; 37 private BinaryMethod m_method;
38 38
39 public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
40 : this(httpMethod, path, binaryMethod, null, null) {}
41
42 public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod, string name, string description)
43 : base(httpMethod, path, name, description)
44 {
45 m_method = binaryMethod;
46 }
47
39 public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 48 public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
40 { 49 {
41 byte[] data = ReadFully(request); 50 byte[] data = ReadFully(request);
@@ -45,12 +54,6 @@ namespace OpenSim.Framework.Servers.HttpServer
45 return Encoding.UTF8.GetBytes(responseString); 54 return Encoding.UTF8.GetBytes(responseString);
46 } 55 }
47 56
48 public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
49 : base(httpMethod, path)
50 {
51 m_method = binaryMethod;
52 }
53
54 private static byte[] ReadFully(Stream stream) 57 private static byte[] ReadFully(Stream stream)
55 { 58 {
56 byte[] buffer = new byte[1024]; 59 byte[] buffer = new byte[1024];
@@ -70,4 +73,4 @@ namespace OpenSim.Framework.Servers.HttpServer
70 } 73 }
71 } 74 }
72 } 75 }
73} 76} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs
index a449c2d..cb5cce5 100644
--- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs
@@ -32,6 +32,25 @@ namespace OpenSim.Framework.Servers.HttpServer
32{ 32{
33 public interface IRequestHandler 33 public interface IRequestHandler
34 { 34 {
35
36 /// <summary>
37 /// Name for this handler.
38 /// </summary>
39 /// <remarks>
40 /// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
41 /// specified.
42 /// </remarks>
43 string Name { get; }
44
45 /// <summary>
46 /// Description for this handler.
47 /// </summary>
48 /// <remarks>
49 /// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
50 /// specified.
51 /// </remarks>
52 string Description { get; }
53
35 // Return response content type 54 // Return response content type
36 string ContentType { get; } 55 string ContentType { get; }
37 56
@@ -58,4 +77,4 @@ namespace OpenSim.Framework.Servers.HttpServer
58 { 77 {
59 Hashtable Handle(string path, Hashtable request); 78 Hashtable Handle(string path, Hashtable request);
60 } 79 }
61} 80} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs
index a467a83..07082a8 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs
@@ -39,7 +39,11 @@ namespace OpenSim.Framework.Servers.HttpServer
39 private RestDeserialiseMethod<TRequest, TResponse> m_method; 39 private RestDeserialiseMethod<TRequest, TResponse> m_method;
40 40
41 public RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method) 41 public RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method)
42 : base(httpMethod, path) 42 : this(httpMethod, path, method, null, null) {}
43
44 public RestDeserialiseHandler(
45 string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method, string name, string description)
46 : base(httpMethod, path, name, description)
43 { 47 {
44 m_method = method; 48 m_method = method;
45 } 49 }
diff --git a/OpenSim/Framework/Servers/HttpServer/RestHTTPHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestHTTPHandler.cs
index 1f23cac..7f89839 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestHTTPHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestHTTPHandler.cs
@@ -38,19 +38,25 @@ namespace OpenSim.Framework.Servers.HttpServer
38 get { return m_dhttpMethod; } 38 get { return m_dhttpMethod; }
39 } 39 }
40 40
41 public override Hashtable Handle(string path, Hashtable request) 41 public RestHTTPHandler(string httpMethod, string path, GenericHTTPMethod dhttpMethod)
42 : base(httpMethod, path)
42 { 43 {
44 m_dhttpMethod = dhttpMethod;
45 }
46
47 public RestHTTPHandler(
48 string httpMethod, string path, GenericHTTPMethod dhttpMethod, string name, string description)
49 : base(httpMethod, path, name, description)
50 {
51 m_dhttpMethod = dhttpMethod;
52 }
43 53
54 public override Hashtable Handle(string path, Hashtable request)
55 {
44 string param = GetParam(path); 56 string param = GetParam(path);
45 request.Add("param", param); 57 request.Add("param", param);
46 request.Add("path", path); 58 request.Add("path", path);
47 return m_dhttpMethod(request); 59 return m_dhttpMethod(request);
48 } 60 }
49
50 public RestHTTPHandler(string httpMethod, string path, GenericHTTPMethod dhttpMethod)
51 : base(httpMethod, path)
52 {
53 m_dhttpMethod = dhttpMethod;
54 }
55 } 61 }
56} 62}
diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
index d2c4002..1f17fee 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
@@ -39,6 +39,15 @@ namespace OpenSim.Framework.Servers.HttpServer
39 get { return m_restMethod; } 39 get { return m_restMethod; }
40 } 40 }
41 41
42 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod)
43 : this(httpMethod, path, restMethod, null, null) {}
44
45 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod, string name, string description)
46 : base(httpMethod, path, name, description)
47 {
48 m_restMethod = restMethod;
49 }
50
42 public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 51 public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
43 { 52 {
44 Encoding encoding = Encoding.UTF8; 53 Encoding encoding = Encoding.UTF8;
@@ -52,10 +61,5 @@ namespace OpenSim.Framework.Servers.HttpServer
52 61
53 return Encoding.UTF8.GetBytes(responseString); 62 return Encoding.UTF8.GetBytes(responseString);
54 } 63 }
55
56 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base(httpMethod, path)
57 {
58 m_restMethod = restMethod;
59 }
60 } 64 }
61} 65}
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index 7ef8bf7..fb818ee 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -26,6 +26,8 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
30using log4net;
29using OpenMetaverse; 31using OpenMetaverse;
30 32
31namespace OpenSim.Framework 33namespace OpenSim.Framework
@@ -35,6 +37,8 @@ namespace OpenSim.Framework
35 /// </summary> 37 /// </summary>
36 public class TaskInventoryItem : ICloneable 38 public class TaskInventoryItem : ICloneable
37 { 39 {
40// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41
38 /// <summary> 42 /// <summary>
39 /// XXX This should really be factored out into some constants class. 43 /// XXX This should really be factored out into some constants class.
40 /// </summary> 44 /// </summary>
@@ -334,12 +338,18 @@ namespace OpenSim.Framework
334 } 338 }
335 } 339 }
336 340
337 public bool OwnerChanged { 341 public bool OwnerChanged
338 get { 342 {
343 get
344 {
339 return _ownerChanged; 345 return _ownerChanged;
340 } 346 }
341 set { 347 set
348 {
342 _ownerChanged = value; 349 _ownerChanged = value;
350// m_log.DebugFormat(
351// "[TASK INVENTORY ITEM]: Owner changed set {0} for {1} {2} owned by {3}",
352// _ownerChanged, Name, ItemID, OwnerID);
343 } 353 }
344 } 354 }
345 355
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 11967c9..6a40cd5 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -53,19 +53,36 @@ namespace OpenSim.Framework
53 LogManager.GetLogger( 53 LogManager.GetLogger(
54 MethodBase.GetCurrentMethod().DeclaringType); 54 MethodBase.GetCurrentMethod().DeclaringType);
55 55
56 private static int m_requestNumber = 0; 56 /// <summary>
57 /// Request number for diagnostic purposes.
58 /// </summary>
59 public static int RequestNumber = 0;
57 60
58 // this is the header field used to communicate the local request id 61 /// <summary>
59 // used for performance and debugging 62 /// this is the header field used to communicate the local request id
63 /// used for performance and debugging
64 /// </summary>
60 public const string OSHeaderRequestID = "opensim-request-id"; 65 public const string OSHeaderRequestID = "opensim-request-id";
61 66
62 // number of milliseconds a call can take before it is considered 67 /// <summary>
63 // a "long" call for warning & debugging purposes 68 /// Number of milliseconds a call can take before it is considered
64 public const int LongCallTime = 500; 69 /// a "long" call for warning & debugging purposes
70 /// </summary>
71 public const int LongCallTime = 3000;
72
73 /// <summary>
74 /// The maximum length of any data logged because of a long request time.
75 /// </summary>
76 /// <remarks>
77 /// This is to truncate any really large post data, such as an asset. In theory, the first section should
78 /// give us useful information about the call (which agent it relates to if applicable, etc.).
79 /// </remarks>
80 public const int MaxRequestDiagLength = 100;
65 81
66 // dictionary of end points 82 /// <summary>
83 /// Dictionary of end points
84 /// </summary>
67 private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>(); 85 private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
68
69 86
70 private static object EndPointLock(string url) 87 private static object EndPointLock(string url)
71 { 88 {
@@ -128,12 +145,13 @@ namespace OpenSim.Framework
128 145
129 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) 146 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
130 { 147 {
131 int reqnum = m_requestNumber++; 148 int reqnum = RequestNumber++;
132 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); 149 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
133 150
134 string errorMessage = "unknown error"; 151 string errorMessage = "unknown error";
135 int tickstart = Util.EnvironmentTickCount(); 152 int tickstart = Util.EnvironmentTickCount();
136 int tickdata = 0; 153 int tickdata = 0;
154 string strBuffer = null;
137 155
138 try 156 try
139 { 157 {
@@ -148,7 +166,7 @@ namespace OpenSim.Framework
148 // If there is some input, write it into the request 166 // If there is some input, write it into the request
149 if (data != null) 167 if (data != null)
150 { 168 {
151 string strBuffer = OSDParser.SerializeJsonString(data); 169 strBuffer = OSDParser.SerializeJsonString(data);
152 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); 170 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
153 171
154 if (compressed) 172 if (compressed)
@@ -209,11 +227,18 @@ namespace OpenSim.Framework
209 } 227 }
210 finally 228 finally
211 { 229 {
212 // This just dumps a warning for any operation that takes more than 100 ms
213 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 230 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
214 if (tickdiff > LongCallTime) 231 if (tickdiff > LongCallTime)
215 m_log.DebugFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing", 232 m_log.InfoFormat(
216 reqnum,url,method,tickdiff,tickdata); 233 "[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
234 reqnum,
235 method,
236 url,
237 tickdiff,
238 tickdata,
239 strBuffer != null
240 ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer)
241 : "");
217 } 242 }
218 243
219 m_log.DebugFormat( 244 m_log.DebugFormat(
@@ -291,17 +316,17 @@ namespace OpenSim.Framework
291 316
292 private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout) 317 private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
293 { 318 {
294 int reqnum = m_requestNumber++; 319 int reqnum = RequestNumber++;
295 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown"; 320 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
296 // m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method); 321 // m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method);
297 322
298 string errorMessage = "unknown error"; 323 string errorMessage = "unknown error";
299 int tickstart = Util.EnvironmentTickCount(); 324 int tickstart = Util.EnvironmentTickCount();
300 int tickdata = 0; 325 int tickdata = 0;
326 string queryString = null;
301 327
302 try 328 try
303 { 329 {
304
305 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); 330 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
306 request.Method = "POST"; 331 request.Method = "POST";
307 request.Timeout = timeout; 332 request.Timeout = timeout;
@@ -312,7 +337,7 @@ namespace OpenSim.Framework
312 337
313 if (data != null) 338 if (data != null)
314 { 339 {
315 string queryString = BuildQueryString(data); 340 queryString = BuildQueryString(data);
316 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); 341 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString);
317 342
318 request.ContentLength = buffer.Length; 343 request.ContentLength = buffer.Length;
@@ -355,11 +380,19 @@ namespace OpenSim.Framework
355 { 380 {
356 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 381 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
357 if (tickdiff > LongCallTime) 382 if (tickdiff > LongCallTime)
358 m_log.InfoFormat("[WEB UTIL]: form request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing", 383 m_log.InfoFormat(
359 reqnum,url,method,tickdiff,tickdata); 384 "[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
385 reqnum,
386 method,
387 url,
388 tickdiff,
389 tickdata,
390 queryString != null
391 ? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString
392 : "");
360 } 393 }
361 394
362 m_log.WarnFormat("[WEB UTIL]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); 395 m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
363 396
364 return ErrorResponseMap(errorMessage); 397 return ErrorResponseMap(errorMessage);
365 } 398 }
@@ -640,8 +673,6 @@ namespace OpenSim.Framework
640 673
641 return new string[0]; 674 return new string[0];
642 } 675 }
643
644
645 } 676 }
646 677
647 public static class AsynchronousRestObjectRequester 678 public static class AsynchronousRestObjectRequester
@@ -664,6 +695,12 @@ namespace OpenSim.Framework
664 public static void MakeRequest<TRequest, TResponse>(string verb, 695 public static void MakeRequest<TRequest, TResponse>(string verb,
665 string requestUrl, TRequest obj, Action<TResponse> action) 696 string requestUrl, TRequest obj, Action<TResponse> action)
666 { 697 {
698 int reqnum = WebUtil.RequestNumber++;
699 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
700
701 int tickstart = Util.EnvironmentTickCount();
702 int tickdata = 0;
703
667 // m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl); 704 // m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
668 705
669 Type type = typeof(TRequest); 706 Type type = typeof(TRequest);
@@ -674,12 +711,13 @@ namespace OpenSim.Framework
674 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); 711 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
675 712
676 request.Method = verb; 713 request.Method = verb;
714 MemoryStream buffer = null;
677 715
678 if (verb == "POST") 716 if (verb == "POST")
679 { 717 {
680 request.ContentType = "text/xml"; 718 request.ContentType = "text/xml";
681 719
682 MemoryStream buffer = new MemoryStream(); 720 buffer = new MemoryStream();
683 721
684 XmlWriterSettings settings = new XmlWriterSettings(); 722 XmlWriterSettings settings = new XmlWriterSettings();
685 settings.Encoding = Encoding.UTF8; 723 settings.Encoding = Encoding.UTF8;
@@ -701,6 +739,9 @@ namespace OpenSim.Framework
701 requestStream.Write(buffer.ToArray(), 0, length); 739 requestStream.Write(buffer.ToArray(), 0, length);
702 requestStream.Close(); 740 requestStream.Close();
703 741
742 // capture how much time was spent writing
743 tickdata = Util.EnvironmentTickCountSubtract(tickstart);
744
704 request.BeginGetResponse(delegate(IAsyncResult ar) 745 request.BeginGetResponse(delegate(IAsyncResult ar)
705 { 746 {
706 response = request.EndGetResponse(ar); 747 response = request.EndGetResponse(ar);
@@ -726,88 +767,108 @@ namespace OpenSim.Framework
726 767
727 }, null); 768 }, null);
728 }, null); 769 }, null);
729
730
731 return;
732 } 770 }
733 771 else
734 request.BeginGetResponse(delegate(IAsyncResult res2)
735 { 772 {
736 try 773 request.BeginGetResponse(delegate(IAsyncResult res2)
737 { 774 {
738 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
739 // documented in MSDN
740 response = request.EndGetResponse(res2);
741
742 Stream respStream = null;
743 try 775 try
744 { 776 {
745 respStream = response.GetResponseStream(); 777 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
746 deserial = (TResponse)deserializer.Deserialize(respStream); 778 // documented in MSDN
747 } 779 response = request.EndGetResponse(res2);
748 catch (System.InvalidOperationException) 780
749 { 781 Stream respStream = null;
750 } 782 try
751 finally 783 {
752 { 784 respStream = response.GetResponseStream();
753 respStream.Close(); 785 deserial = (TResponse)deserializer.Deserialize(respStream);
754 response.Close(); 786 }
787 catch (System.InvalidOperationException)
788 {
789 }
790 finally
791 {
792 respStream.Close();
793 response.Close();
794 }
755 } 795 }
756 } 796 catch (WebException e)
757 catch (WebException e)
758 {
759 if (e.Status == WebExceptionStatus.ProtocolError)
760 { 797 {
761 if (e.Response is HttpWebResponse) 798 if (e.Status == WebExceptionStatus.ProtocolError)
762 { 799 {
763 HttpWebResponse httpResponse = (HttpWebResponse)e.Response; 800 if (e.Response is HttpWebResponse)
764
765 if (httpResponse.StatusCode != HttpStatusCode.NotFound)
766 { 801 {
767 // We don't appear to be handling any other status codes, so log these feailures to that 802 HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
768 // people don't spend unnecessary hours hunting phantom bugs. 803
769 m_log.DebugFormat( 804 if (httpResponse.StatusCode != HttpStatusCode.NotFound)
770 "[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}", 805 {
771 verb, requestUrl, httpResponse.StatusCode); 806 // We don't appear to be handling any other status codes, so log these feailures to that
807 // people don't spend unnecessary hours hunting phantom bugs.
808 m_log.DebugFormat(
809 "[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
810 verb, requestUrl, httpResponse.StatusCode);
811 }
772 } 812 }
773 } 813 }
814 else
815 {
816 m_log.ErrorFormat(
817 "[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}",
818 verb, requestUrl, e.Status, e.Message);
819 }
774 } 820 }
775 else 821 catch (Exception e)
776 { 822 {
777 m_log.ErrorFormat( 823 m_log.ErrorFormat(
778 "[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", 824 "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
779 verb, requestUrl, e.Status, e.Message); 825 verb, requestUrl, e.Message, e.StackTrace);
780 } 826 }
781 } 827
782 catch (Exception e) 828 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
783 { 829
784 m_log.ErrorFormat( 830 try
785 "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", 831 {
786 verb, requestUrl, e.Message, e.StackTrace); 832 action(deserial);
787 } 833 }
834 catch (Exception e)
835 {
836 m_log.ErrorFormat(
837 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}",
838 verb, requestUrl, e.Message, e.StackTrace);
839 }
840
841 }, null);
842 }
788 843
789 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); 844 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
845 if (tickdiff > WebUtil.LongCallTime)
846 {
847 string originalRequest = null;
790 848
791 try 849 if (buffer != null)
792 {
793 action(deserial);
794 }
795 catch (Exception e)
796 { 850 {
797 m_log.ErrorFormat( 851 originalRequest = Encoding.UTF8.GetString(buffer.ToArray());
798 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}", 852
799 verb, requestUrl, e.Message, e.StackTrace); 853 if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
854 originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
800 } 855 }
801 856
802 }, null); 857 m_log.InfoFormat(
858 "[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
859 reqnum,
860 verb,
861 requestUrl,
862 tickdiff,
863 tickdata,
864 originalRequest);
865 }
803 } 866 }
804 } 867 }
805 868
806 public static class SynchronousRestFormsRequester 869 public static class SynchronousRestFormsRequester
807 { 870 {
808 private static readonly ILog m_log = 871 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
809 LogManager.GetLogger(
810 MethodBase.GetCurrentMethod().DeclaringType);
811 872
812 /// <summary> 873 /// <summary>
813 /// Perform a synchronous REST request. 874 /// Perform a synchronous REST request.
@@ -821,6 +882,12 @@ namespace OpenSim.Framework
821 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> 882 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
822 public static string MakeRequest(string verb, string requestUrl, string obj) 883 public static string MakeRequest(string verb, string requestUrl, string obj)
823 { 884 {
885 int reqnum = WebUtil.RequestNumber++;
886 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
887
888 int tickstart = Util.EnvironmentTickCount();
889 int tickdata = 0;
890
824 WebRequest request = WebRequest.Create(requestUrl); 891 WebRequest request = WebRequest.Create(requestUrl);
825 request.Method = verb; 892 request.Method = verb;
826 string respstring = String.Empty; 893 string respstring = String.Empty;
@@ -856,6 +923,9 @@ namespace OpenSim.Framework
856 { 923 {
857 if (requestStream != null) 924 if (requestStream != null)
858 requestStream.Close(); 925 requestStream.Close();
926
927 // capture how much time was spent writing
928 tickdata = Util.EnvironmentTickCountSubtract(tickstart);
859 } 929 }
860 } 930 }
861 931
@@ -894,6 +964,18 @@ namespace OpenSim.Framework
894 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving {0} {1}", verb, requestUrl); 964 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving {0} {1}", verb, requestUrl);
895 } 965 }
896 } 966 }
967
968 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
969 if (tickdiff > WebUtil.LongCallTime)
970 m_log.InfoFormat(
971 "[FORMS]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
972 reqnum,
973 verb,
974 requestUrl,
975 tickdiff,
976 tickdata,
977 obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
978
897 return respstring; 979 return respstring;
898 } 980 }
899 } 981 }
@@ -921,6 +1003,12 @@ namespace OpenSim.Framework
921 1003
922 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout) 1004 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
923 { 1005 {
1006 int reqnum = WebUtil.RequestNumber++;
1007 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
1008
1009 int tickstart = Util.EnvironmentTickCount();
1010 int tickdata = 0;
1011
924 Type type = typeof(TRequest); 1012 Type type = typeof(TRequest);
925 TResponse deserial = default(TResponse); 1013 TResponse deserial = default(TResponse);
926 1014
@@ -928,12 +1016,13 @@ namespace OpenSim.Framework
928 request.Method = verb; 1016 request.Method = verb;
929 if (pTimeout != 0) 1017 if (pTimeout != 0)
930 request.Timeout = pTimeout * 1000; 1018 request.Timeout = pTimeout * 1000;
1019 MemoryStream buffer = null;
931 1020
932 if ((verb == "POST") || (verb == "PUT")) 1021 if ((verb == "POST") || (verb == "PUT"))
933 { 1022 {
934 request.ContentType = "text/xml"; 1023 request.ContentType = "text/xml";
935 1024
936 MemoryStream buffer = new MemoryStream(); 1025 buffer = new MemoryStream();
937 1026
938 XmlWriterSettings settings = new XmlWriterSettings(); 1027 XmlWriterSettings settings = new XmlWriterSettings();
939 settings.Encoding = Encoding.UTF8; 1028 settings.Encoding = Encoding.UTF8;
@@ -966,6 +1055,9 @@ namespace OpenSim.Framework
966 { 1055 {
967 if (requestStream != null) 1056 if (requestStream != null)
968 requestStream.Close(); 1057 requestStream.Close();
1058
1059 // capture how much time was spent writing
1060 tickdata = Util.EnvironmentTickCountSubtract(tickstart);
969 } 1061 }
970 } 1062 }
971 1063
@@ -1013,7 +1105,30 @@ namespace OpenSim.Framework
1013 verb, requestUrl, e.Message, e.StackTrace); 1105 verb, requestUrl, e.Message, e.StackTrace);
1014 } 1106 }
1015 1107
1108 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
1109 if (tickdiff > WebUtil.LongCallTime)
1110 {
1111 string originalRequest = null;
1112
1113 if (buffer != null)
1114 {
1115 originalRequest = Encoding.UTF8.GetString(buffer.ToArray());
1116
1117 if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
1118 originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
1119 }
1120
1121 m_log.InfoFormat(
1122 "[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
1123 reqnum,
1124 verb,
1125 requestUrl,
1126 tickdiff,
1127 tickdata,
1128 originalRequest);
1129 }
1130
1016 return deserial; 1131 return deserial;
1017 } 1132 }
1018 } 1133 }
1019} \ No newline at end of file 1134}
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index ddc7f10..a0c9a0a 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -437,7 +437,7 @@ namespace OpenSim
437 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 437 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
438 438
439 // TODO : Try setting resource for region xstats here on scene 439 // TODO : Try setting resource for region xstats here on scene
440 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 440 MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));
441 441
442 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 442 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
443 scene.EventManager.TriggerParcelPrimCountUpdate(); 443 scene.EventManager.TriggerParcelPrimCountUpdate();
@@ -856,6 +856,9 @@ namespace OpenSim
856 return Util.UTF8.GetBytes("OK"); 856 return Util.UTF8.GetBytes("OK");
857 } 857 }
858 858
859 public string Name { get { return "SimStatus"; } }
860 public string Description { get { return "Simulator Status"; } }
861
859 public string ContentType 862 public string ContentType
860 { 863 {
861 get { return "text/plain"; } 864 get { return "text/plain"; }
@@ -880,6 +883,9 @@ namespace OpenSim
880 { 883 {
881 OpenSimBase m_opensim; 884 OpenSimBase m_opensim;
882 string osXStatsURI = String.Empty; 885 string osXStatsURI = String.Empty;
886
887 public string Name { get { return "XSimStatus"; } }
888 public string Description { get { return "Simulator XStatus"; } }
883 889
884 public XSimStatusHandler(OpenSimBase sim) 890 public XSimStatusHandler(OpenSimBase sim)
885 { 891 {
@@ -920,6 +926,9 @@ namespace OpenSim
920 { 926 {
921 OpenSimBase m_opensim; 927 OpenSimBase m_opensim;
922 string osUXStatsURI = String.Empty; 928 string osUXStatsURI = String.Empty;
929
930 public string Name { get { return "UXSimStatus"; } }
931 public string Description { get { return "Simulator UXStatus"; } }
923 932
924 public UXSimStatusHandler(OpenSimBase sim) 933 public UXSimStatusHandler(OpenSimBase sim)
925 { 934 {
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 2c2d80a..f14beb0 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -158,7 +158,9 @@ namespace OpenSim.Region.ClientStack.Linden
158 try 158 try
159 { 159 {
160 // the root of all evil 160 // the root of all evil
161 m_HostCapsObj.RegisterHandler("SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest)); 161 m_HostCapsObj.RegisterHandler(
162 "SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null));
163
162 m_log.DebugFormat( 164 m_log.DebugFormat(
163 "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID); 165 "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
164 166
@@ -166,7 +168,10 @@ namespace OpenSim.Region.ClientStack.Linden
166 // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", 168 // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
167 // capsBase + m_mapLayerPath, 169 // capsBase + m_mapLayerPath,
168 // GetMapLayer); 170 // GetMapLayer);
169 IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); 171 IRequestHandler req
172 = new RestStreamHandler(
173 "POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory, "UpdateScript", null);
174
170 m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req); 175 m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
171 m_HostCapsObj.RegisterHandler("UpdateScriptTask", req); 176 m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
172 } 177 }
@@ -181,14 +186,22 @@ namespace OpenSim.Region.ClientStack.Linden
181 try 186 try
182 { 187 {
183 // I don't think this one works... 188 // I don't think this one works...
184 m_HostCapsObj.RegisterHandler("NewFileAgentInventory", new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", 189 m_HostCapsObj.RegisterHandler(
185 capsBase + m_newInventory, 190 "NewFileAgentInventory",
186 NewAgentInventoryRequest)); 191 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>(
187 IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory); 192 "POST",
193 capsBase + m_newInventory,
194 NewAgentInventoryRequest,
195 "NewFileAgentInventory",
196 null));
197
198 IRequestHandler req
199 = new RestStreamHandler(
200 "POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory, "Update*", null);
201
188 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); 202 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
189 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); 203 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
190 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); 204 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
191 m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
192 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData); 205 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData);
193 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); 206 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
194 IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost); 207 IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost);
@@ -197,6 +210,12 @@ namespace OpenSim.Region.ClientStack.Linden
197 m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler); 210 m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
198 211
199 212
213
214 m_HostCapsObj.RegisterHandler(
215 "CopyInventoryFromNotecard",
216 new RestStreamHandler(
217 "POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null));
218
200 // As of RC 1.22.9 of the Linden client this is 219 // As of RC 1.22.9 of the Linden client this is
201 // supported 220 // supported
202 221
@@ -299,7 +318,9 @@ namespace OpenSim.Region.ClientStack.Linden
299 m_dumpAssetsToFile); 318 m_dumpAssetsToFile);
300 uploader.OnUpLoad += TaskScriptUpdated; 319 uploader.OnUpLoad += TaskScriptUpdated;
301 320
302 m_HostCapsObj.HttpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 321 m_HostCapsObj.HttpListener.AddStreamHandler(
322 new BinaryStreamHandler(
323 "POST", capsBase + uploaderPath, uploader.uploaderCaps, "BunchOfCaps", null));
303 324
304 string protocol = "http://"; 325 string protocol = "http://";
305 326
@@ -426,8 +447,14 @@ namespace OpenSim.Region.ClientStack.Linden
426 AssetUploader uploader = 447 AssetUploader uploader =
427 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, 448 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
428 llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile); 449 llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
450
429 m_HostCapsObj.HttpListener.AddStreamHandler( 451 m_HostCapsObj.HttpListener.AddStreamHandler(
430 new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 452 new BinaryStreamHandler(
453 "POST",
454 capsBase + uploaderPath,
455 uploader.uploaderCaps,
456 "NewAgentInventoryRequest",
457 m_HostCapsObj.AgentID.ToString()));
431 458
432 string protocol = "http://"; 459 string protocol = "http://";
433 460
@@ -743,7 +770,8 @@ namespace OpenSim.Region.ClientStack.Linden
743 uploader.OnUpLoad += ItemUpdated; 770 uploader.OnUpLoad += ItemUpdated;
744 771
745 m_HostCapsObj.HttpListener.AddStreamHandler( 772 m_HostCapsObj.HttpListener.AddStreamHandler(
746 new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 773 new BinaryStreamHandler(
774 "POST", capsBase + uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null));
747 775
748 string protocol = "http://"; 776 string protocol = "http://";
749 777
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index a91b02c..a38d231 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -351,14 +351,18 @@ namespace OpenSim.Region.ClientStack.Linden
351 // EventQueueGet when it receive capability information, but then we replace the rest handler immediately 351 // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
352 // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but 352 // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but
353 // really it should be possible to directly register the poll handler as a capability. 353 // really it should be possible to directly register the poll handler as a capability.
354 caps.RegisterHandler("EventQueueGet", 354 caps.RegisterHandler(
355 new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", null)); 355 "EventQueueGet",
356 new RestHTTPHandler(
357 "POST", capsBase + EventQueueGetUUID.ToString() + "/", null));
358
356// delegate(Hashtable m_dhttpMethod) 359// delegate(Hashtable m_dhttpMethod)
357// { 360// {
358// return ProcessQueue(m_dhttpMethod, agentID, caps); 361// return ProcessQueue(m_dhttpMethod, agentID, caps);
359// })); 362// }));
360 363
361 // This will persist this beyond the expiry of the caps handlers 364 // This will persist this beyond the expiry of the caps handlers
365 // TODO: Add EventQueueGet name/description for diagnostics
362 MainServer.Instance.AddPollServiceHTTPHandler( 366 MainServer.Instance.AddPollServiceHTTPHandler(
363 capsBase + EventQueueGetUUID.ToString() + "/", 367 capsBase + EventQueueGetUUID.ToString() + "/",
364 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); 368 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
index 14501c7..cb5afcc 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
@@ -132,7 +132,8 @@ namespace OpenSim.Region.ClientStack.Linden
132 capUrl = "/CAPS/" + UUID.Random(); 132 capUrl = "/CAPS/" + UUID.Random();
133 133
134 IRequestHandler reqHandler 134 IRequestHandler reqHandler
135 = new RestStreamHandler("POST", capUrl, m_fetchHandler.FetchInventoryRequest); 135 = new RestStreamHandler(
136 "POST", capUrl, m_fetchHandler.FetchInventoryRequest, capName, agentID.ToString());
136 137
137 caps.RegisterHandler(capName, reqHandler); 138 caps.RegisterHandler(capName, reqHandler);
138 } 139 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index e7bd2e7..0d7b1fc 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -120,11 +120,13 @@ namespace OpenSim.Region.ClientStack.Linden
120 { 120 {
121// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 121// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
122 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); 122 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
123 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), 123 IRequestHandler reqHandler
124 delegate(Hashtable m_dhttpMethod) 124 = new RestHTTPHandler(
125 { 125 "GET",
126 return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null); 126 "/CAPS/" + UUID.Random(),
127 }); 127 httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
128 "GetMesh",
129 agentID.ToString());
128 130
129 caps.RegisterHandler("GetMesh", reqHandler); 131 caps.RegisterHandler("GetMesh", reqHandler);
130 } 132 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index fffcee2..5ae9cc3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -130,7 +130,9 @@ namespace OpenSim.Region.ClientStack.Linden
130 if (m_URL == "localhost") 130 if (m_URL == "localhost")
131 { 131 {
132// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 132// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
133 caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService)); 133 caps.RegisterHandler(
134 "GetTexture",
135 new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString()));
134 } 136 }
135 else 137 else
136 { 138 {
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
index 18c7eae..44a6883 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
@@ -117,7 +117,9 @@ namespace OpenSim.Region.ClientStack.Linden
117 117
118 public void RegisterCaps(UUID agentID, Caps caps) 118 public void RegisterCaps(UUID agentID, Caps caps)
119 { 119 {
120 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag); 120 IRequestHandler reqHandler
121 = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag, "MeshUploadFlag", agentID.ToString());
122
121 caps.RegisterHandler("MeshUploadFlag", reqHandler); 123 caps.RegisterHandler("MeshUploadFlag", reqHandler);
122 m_agentID = agentID; 124 m_agentID = agentID;
123 } 125 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
index 91872c5..52c4f44 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
@@ -115,67 +115,66 @@ namespace OpenSim.Region.ClientStack.Linden
115 UUID capID = UUID.Random(); 115 UUID capID = UUID.Random();
116 116
117// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID); 117// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);
118 caps.RegisterHandler("NewFileAgentInventoryVariablePrice", 118 caps.RegisterHandler(
119 119 "NewFileAgentInventoryVariablePrice",
120 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST", 120 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>(
121 "/CAPS/" + capID.ToString(), 121 "POST",
122 delegate(LLSDAssetUploadRequest req) 122 "/CAPS/" + capID.ToString(),
123 { 123 req => NewAgentInventoryRequest(req, agentID),
124 return NewAgentInventoryRequest(req,agentID); 124 "NewFileAgentInventoryVariablePrice",
125 })); 125 agentID.ToString()));
126
127 } 126 }
128 127
129 #endregion 128 #endregion
130 129
131 public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID) 130 public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID)
132 { 131 {
133
134 //TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit 132 //TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit
135 // You need to be aware of this and 133 // you need to be aware of this
136
137 134
138 //if (llsdRequest.asset_type == "texture" || 135 //if (llsdRequest.asset_type == "texture" ||
139 // llsdRequest.asset_type == "animation" || 136 // llsdRequest.asset_type == "animation" ||
140 // llsdRequest.asset_type == "sound") 137 // llsdRequest.asset_type == "sound")
141 // { 138 // {
142 // check user level 139 // check user level
143 ScenePresence avatar = null;
144 IClientAPI client = null;
145 m_scene.TryGetScenePresence(agentID, out avatar);
146 140
147 if (avatar != null) 141 ScenePresence avatar = null;
142 IClientAPI client = null;
143 m_scene.TryGetScenePresence(agentID, out avatar);
144
145 if (avatar != null)
146 {
147 client = avatar.ControllingClient;
148
149 if (avatar.UserLevel < m_levelUpload)
148 { 150 {
149 client = avatar.ControllingClient; 151 if (client != null)
150 152 client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
151 if (avatar.UserLevel < m_levelUpload) 153
152 { 154 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
153 if (client != null) 155 errorResponse.rsvp = "";
154 client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false); 156 errorResponse.state = "error";
155 157 return errorResponse;
156 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
157 errorResponse.rsvp = "";
158 errorResponse.state = "error";
159 return errorResponse;
160 }
161 } 158 }
159 }
162 160
163 // check funds 161 // check funds
164 IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); 162 IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
165 163
166 if (mm != null) 164 if (mm != null)
165 {
166 if (!mm.UploadCovered(agentID, mm.UploadCharge))
167 { 167 {
168 if (!mm.UploadCovered(agentID, mm.UploadCharge)) 168 if (client != null)
169 { 169 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
170 if (client != null) 170
171 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); 171 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
172 172 errorResponse.rsvp = "";
173 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); 173 errorResponse.state = "error";
174 errorResponse.rsvp = ""; 174 return errorResponse;
175 errorResponse.state = "error";
176 return errorResponse;
177 }
178 } 175 }
176 }
177
179 // } 178 // }
180 179
181 string assetName = llsdRequest.name; 180 string assetName = llsdRequest.name;
@@ -189,8 +188,14 @@ namespace OpenSim.Region.ClientStack.Linden
189 AssetUploader uploader = 188 AssetUploader uploader =
190 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, 189 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
191 llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile); 190 llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile);
191
192 MainServer.Instance.AddStreamHandler( 192 MainServer.Instance.AddStreamHandler(
193 new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 193 new BinaryStreamHandler(
194 "POST",
195 capsBase + uploaderPath,
196 uploader.uploaderCaps,
197 "NewFileAgentInventoryVariablePrice",
198 agentID.ToString()));
194 199
195 string protocol = "http://"; 200 string protocol = "http://";
196 201
@@ -199,10 +204,9 @@ namespace OpenSim.Region.ClientStack.Linden
199 204
200 string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase + 205 string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase +
201 uploaderPath; 206 uploaderPath;
202 207
203 208
204 LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); 209 LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
205
206 210
207 uploadResponse.rsvp = uploaderURL; 211 uploadResponse.rsvp = uploaderURL;
208 uploadResponse.state = "upload"; 212 uploadResponse.state = "upload";
@@ -220,6 +224,7 @@ namespace OpenSim.Region.ClientStack.Linden
220 pinventoryItem, pparentFolder, pdata, pinventoryType, 224 pinventoryItem, pparentFolder, pdata, pinventoryType,
221 passetType,agentID); 225 passetType,agentID);
222 }; 226 };
227
223 return uploadResponse; 228 return uploadResponse;
224 } 229 }
225 230
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
index 1c47f0e..4ccfc43 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
@@ -66,12 +66,14 @@ namespace OpenSim.Region.ClientStack.Linden
66 66
67// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); 67// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
68 68
69 caps.RegisterHandler("ObjectAdd", 69 caps.RegisterHandler(
70 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", 70 "ObjectAdd",
71 delegate(Hashtable m_dhttpMethod) 71 new RestHTTPHandler(
72 { 72 "POST",
73 return ProcessAdd(m_dhttpMethod, agentID, caps); 73 "/CAPS/OA/" + capuuid + "/",
74 })); 74 httpMethod => ProcessAdd(httpMethod, agentID, caps),
75 "ObjectAdd",
76 agentID.ToString()));;
75 } 77 }
76 78
77 public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap) 79 public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index 7a3d97e..f0f3984 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -106,12 +106,15 @@ namespace OpenSim.Region.ClientStack.Linden
106 UUID capID = UUID.Random(); 106 UUID capID = UUID.Random();
107 107
108// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID); 108// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
109 caps.RegisterHandler("UploadObjectAsset", 109 caps.RegisterHandler(
110 new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", 110 "UploadObjectAsset",
111 delegate(Hashtable m_dhttpMethod) 111 new RestHTTPHandler(
112 { 112 "POST",
113 return ProcessAdd(m_dhttpMethod, agentID, caps); 113 "/CAPS/OA/" + capID + "/",
114 })); 114 httpMethod => ProcessAdd(httpMethod, agentID, caps),
115 "UploadObjectAsset",
116 agentID.ToString()));
117
115 /* 118 /*
116 caps.RegisterHandler("NewFileAgentInventoryVariablePrice", 119 caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
117 120
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
index 1dd8938..8ed0fb3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
@@ -154,7 +154,9 @@ namespace OpenSim.Region.ClientStack.Linden
154 public void RegisterCaps(UUID agentID, Caps caps) 154 public void RegisterCaps(UUID agentID, Caps caps)
155 { 155 {
156 IRequestHandler reqHandler 156 IRequestHandler reqHandler
157 = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), HandleSimulatorFeaturesRequest); 157 = new RestHTTPHandler(
158 "GET", "/CAPS/" + UUID.Random(),
159 HandleSimulatorFeaturesRequest, "SimulatorFeatures", agentID.ToString());
158 160
159 caps.RegisterHandler("SimulatorFeatures", reqHandler); 161 caps.RegisterHandler("SimulatorFeatures", reqHandler);
160 } 162 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
index 45d6071..b3d61a8 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs
@@ -106,7 +106,9 @@ namespace OpenSim.Region.ClientStack.Linden
106 "POST", 106 "POST",
107 "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, 107 "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath,
108 new UploadBakedTextureHandler( 108 new UploadBakedTextureHandler(
109 caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); 109 caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture,
110 "UploadBakedTexture",
111 agentID.ToString()));
110 } 112 }
111 } 113 }
112} \ No newline at end of file 114} \ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 10f43d1..2359bd6 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -144,7 +144,12 @@ namespace OpenSim.Region.ClientStack.Linden
144 capUrl = "/CAPS/" + UUID.Random(); 144 capUrl = "/CAPS/" + UUID.Random();
145 145
146 IRequestHandler reqHandler 146 IRequestHandler reqHandler
147 = new RestStreamHandler("POST", capUrl, m_webFetchHandler.FetchInventoryDescendentsRequest); 147 = new RestStreamHandler(
148 "POST",
149 capUrl,
150 m_webFetchHandler.FetchInventoryDescendentsRequest,
151 "FetchInventoryDescendents2",
152 agentID.ToString());
148 153
149 caps.RegisterHandler(capName, reqHandler); 154 caps.RegisterHandler(capName, reqHandler);
150 } 155 }
@@ -160,4 +165,4 @@ namespace OpenSim.Region.ClientStack.Linden
160// capName, capUrl, m_scene.RegionInfo.RegionName, agentID); 165// capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
161 } 166 }
162 } 167 }
163} 168} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 127ca1d..7054825 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -83,7 +83,7 @@ namespace Flotsam.RegionModules.AssetCache
83 private Dictionary<string, ManualResetEvent> m_CurrentlyWriting = new Dictionary<string, ManualResetEvent>(); 83 private Dictionary<string, ManualResetEvent> m_CurrentlyWriting = new Dictionary<string, ManualResetEvent>();
84 private int m_WaitOnInprogressTimeout = 3000; 84 private int m_WaitOnInprogressTimeout = 3000;
85#else 85#else
86 private List<string> m_CurrentlyWriting = new List<string>(); 86 private HashSet<string> m_CurrentlyWriting = new HashSet<string>();
87#endif 87#endif
88 88
89 private bool m_FileCacheEnabled = true; 89 private bool m_FileCacheEnabled = true;
@@ -272,7 +272,11 @@ namespace Flotsam.RegionModules.AssetCache
272 // the other thread has updated the time for us. 272 // the other thread has updated the time for us.
273 try 273 try
274 { 274 {
275 File.SetLastAccessTime(filename, DateTime.Now); 275 lock (m_CurrentlyWriting)
276 {
277 if (!m_CurrentlyWriting.Contains(filename))
278 File.SetLastAccessTime(filename, DateTime.Now);
279 }
276 } 280 }
277 catch 281 catch
278 { 282 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 69aa0ed..2bfe190 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -578,9 +578,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
578 private void AttachToAgent( 578 private void AttachToAgent(
579 IScenePresence sp, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) 579 IScenePresence sp, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
580 { 580 {
581 // m_log.DebugFormat( 581// m_log.DebugFormat(
582 // "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", 582// "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}",
583 // so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); 583// so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos);
584 584
585 so.DetachFromBackup(); 585 so.DetachFromBackup();
586 586
@@ -845,9 +845,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
845 /// <param name="att"></param> 845 /// <param name="att"></param>
846 private void ShowAttachInUserInventory(IScenePresence sp, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 846 private void ShowAttachInUserInventory(IScenePresence sp, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
847 { 847 {
848 // m_log.DebugFormat( 848// m_log.DebugFormat(
849 // "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}", 849// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
850 // att.Name, sp.Name, AttachmentPt, itemID); 850// att.Name, sp.Name, AttachmentPt, itemID);
851 851
852 if (UUID.Zero == itemID) 852 if (UUID.Zero == itemID)
853 { 853 {
@@ -910,9 +910,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
910 910
911 private void Client_OnObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) 911 private void Client_OnObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
912 { 912 {
913 // m_log.DebugFormat( 913// m_log.DebugFormat(
914 // "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})", 914// "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})",
915 // objectLocalID, remoteClient.Name, AttachmentPt, silent); 915// objectLocalID, remoteClient.Name, AttachmentPt, silent);
916 916
917 if (!Enabled) 917 if (!Enabled)
918 return; 918 return;
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index 0babeb5..3a91465 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -96,6 +96,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
96 ScenePresence killingAvatar = null; 96 ScenePresence killingAvatar = null;
97// string killingAvatarMessage; 97// string killingAvatarMessage;
98 98
99 // check to see if it is an NPC and just remove it
100 INPCModule NPCmodule = deadAvatar.Scene.RequestModuleInterface<INPCModule>();
101 if (NPCmodule != null && NPCmodule.DeleteNPC(deadAvatar.UUID, deadAvatar.Scene))
102 {
103 return;
104 }
105
99 if (killerObjectLocalID == 0) 106 if (killerObjectLocalID == 0)
100 deadAvatarMessage = "You committed suicide!"; 107 deadAvatarMessage = "You committed suicide!";
101 else 108 else
@@ -145,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
145 catch (InvalidOperationException) 152 catch (InvalidOperationException)
146 { } 153 { }
147 154
148 deadAvatar.Health = 100; 155 deadAvatar.setHealthWithUpdate(100.0f);
149 deadAvatar.Scene.TeleportClientHome(deadAvatar.UUID, deadAvatar.ControllingClient); 156 deadAvatar.Scene.TeleportClientHome(deadAvatar.UUID, deadAvatar.ControllingClient);
150 } 157 }
151 158
@@ -154,14 +161,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
154 try 161 try
155 { 162 {
156 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 163 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
157 164 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
158 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) 165 || avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
159 { 166 {
160 avatar.Invulnerable = false; 167 avatar.Invulnerable = false;
161 } 168 }
162 else 169 else
163 { 170 {
164 avatar.Invulnerable = true; 171 avatar.Invulnerable = true;
172 if (avatar.Health < 100.0f)
173 {
174 avatar.setHealthWithUpdate(100.0f);
175 }
165 } 176 }
166 } 177 }
167 catch (Exception) 178 catch (Exception)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a31e0aa..d4fbdce 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -30,7 +30,6 @@ using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Reflection; 31using System.Reflection;
32using System.Threading; 32using System.Threading;
33
34using OpenSim.Framework; 33using OpenSim.Framework;
35using OpenSim.Framework.Capabilities; 34using OpenSim.Framework.Capabilities;
36using OpenSim.Framework.Client; 35using OpenSim.Framework.Client;
@@ -596,7 +595,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
596 595
597 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 596 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
598 { 597 {
599// Thread.Sleep(5000); 598 // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
599 // they regard the new region as the current region after receiving the AgentMovementComplete
600 // response. If close is sent before then, it will cause the viewer to quit instead.
601 // However, if this delay is longer, then a viewer can teleport back to this region and experience
602 // a failure because the old ScenePresence has not yet been cleaned up.
603 Thread.Sleep(2000);
604
600 sp.Close(); 605 sp.Close();
601 sp.Scene.IncomingCloseAgent(sp.UUID); 606 sp.Scene.IncomingCloseAgent(sp.UUID);
602 } 607 }
@@ -1913,12 +1918,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1913 Thread.Sleep(100); 1918 Thread.Sleep(100);
1914 } 1919 }
1915 1920
1916 if (count > 0) 1921 return count > 0;
1917 return true;
1918 else
1919 return false;
1920
1921 return true;
1922 } 1922 }
1923 1923
1924 protected void SetInTransit(UUID id) 1924 protected void SetInTransit(UUID id)
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index f4cf6b4..199dd11 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -147,6 +147,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
147 public void Close() 147 public void Close()
148 { 148 {
149 } 149 }
150
150 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) 151 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
151 { 152 {
152 UUID urlcode = UUID.Random(); 153 UUID urlcode = UUID.Random();
@@ -176,6 +177,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
176 uri, 177 uri,
177 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); 178 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
178 179
180 m_log.DebugFormat(
181 "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}",
182 uri, itemID, host.Name, host.LocalId);
183
179 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 184 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
180 } 185 }
181 186
@@ -218,6 +223,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
218 uri, 223 uri,
219 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); 224 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
220 225
226 m_log.DebugFormat(
227 "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
228 uri, itemID, host.Name, host.LocalId);
229
221 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 230 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
222 } 231 }
223 232
@@ -241,6 +250,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
241 m_RequestMap.Remove(req); 250 m_RequestMap.Remove(req);
242 } 251 }
243 252
253// m_log.DebugFormat(
254// "[URL MODULE]: Releasing url {0} for {1} in {2}",
255// url, data.itemID, data.hostID);
256
244 RemoveUrl(data); 257 RemoveUrl(data);
245 m_UrlMap.Remove(url); 258 m_UrlMap.Remove(url);
246 } 259 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
index f0d21e6..4470799 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
55 MethodBase.GetCurrentMethod().DeclaringType); 55 MethodBase.GetCurrentMethod().DeclaringType);
56 56
57 private IUserManagement m_UserManagement; 57 private IUserManagement m_UserManagement;
58 private IGridService m_GridService; 58// private IGridService m_GridService;
59 59
60 private Scene m_Scene; 60 private Scene m_Scene;
61 AccessFlags m_accessValue = AccessFlags.None; 61 AccessFlags m_accessValue = AccessFlags.None;
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
65 { 65 {
66 m_Scene = scene; 66 m_Scene = scene;
67 m_UserManagement = scene.RequestModuleInterface<IUserManagement>(); 67 m_UserManagement = scene.RequestModuleInterface<IUserManagement>();
68 m_GridService = scene.GridService; 68// m_GridService = scene.GridService;
69 69
70 if (config != null) 70 if (config != null)
71 { 71 {
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 06d5587..2fa0b3f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1392,21 +1392,26 @@ namespace OpenSim.Region.CoreModules.World.Land
1392 private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) 1392 private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
1393 { 1393 {
1394 string capsBase = "/CAPS/" + caps.CapsObjectPath; 1394 string capsBase = "/CAPS/" + caps.CapsObjectPath;
1395 caps.RegisterHandler("RemoteParcelRequest", 1395 caps.RegisterHandler(
1396 new RestStreamHandler("POST", capsBase + remoteParcelRequestPath, 1396 "RemoteParcelRequest",
1397 delegate(string request, string path, string param, 1397 new RestStreamHandler(
1398 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 1398 "POST",
1399 { 1399 capsBase + remoteParcelRequestPath,
1400 return RemoteParcelRequest(request, path, param, agentID, caps); 1400 (request, path, param, httpRequest, httpResponse)
1401 })); 1401 => RemoteParcelRequest(request, path, param, agentID, caps),
1402 "RemoteParcelRequest",
1403 agentID.ToString()));
1404
1402 UUID parcelCapID = UUID.Random(); 1405 UUID parcelCapID = UUID.Random();
1403 caps.RegisterHandler("ParcelPropertiesUpdate", 1406 caps.RegisterHandler(
1404 new RestStreamHandler("POST", "/CAPS/" + parcelCapID, 1407 "ParcelPropertiesUpdate",
1405 delegate(string request, string path, string param, 1408 new RestStreamHandler(
1406 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 1409 "POST",
1407 { 1410 "/CAPS/" + parcelCapID,
1408 return ProcessPropertiesUpdate(request, path, param, agentID, caps); 1411 (request, path, param, httpRequest, httpResponse)
1409 })); 1412 => ProcessPropertiesUpdate(request, path, param, agentID, caps),
1413 "ParcelPropertiesUpdate",
1414 agentID.ToString()));
1410 } 1415 }
1411 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) 1416 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
1412 { 1417 {
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index 5122734..102b4d7 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -126,7 +126,6 @@ namespace OpenSim.Region.CoreModules.World.Land
126// m_log.DebugFormat( 126// m_log.DebugFormat(
127// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", 127// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted",
128// obj.Name, m_Scene.RegionInfo.RegionName); 128// obj.Name, m_Scene.RegionInfo.RegionName);
129
130 } 129 }
131 } 130 }
132 131
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index 5239f50..601e81e 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -145,7 +145,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
145 145
146 // Even though we're registering for POST we're going to get GETS and UPDATES too 146 // Even though we're registering for POST we're going to get GETS and UPDATES too
147 caps.RegisterHandler( 147 caps.RegisterHandler(
148 "ObjectMedia", new RestStreamHandler("POST", omCapUrl, HandleObjectMediaMessage)); 148 "ObjectMedia",
149 new RestStreamHandler(
150 "POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString()));
149 } 151 }
150 152
151 string omuCapUrl = "/CAPS/" + UUID.Random(); 153 string omuCapUrl = "/CAPS/" + UUID.Random();
@@ -157,7 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
157 159
158 // Even though we're registering for POST we're going to get GETS and UPDATES too 160 // Even though we're registering for POST we're going to get GETS and UPDATES too
159 caps.RegisterHandler( 161 caps.RegisterHandler(
160 "ObjectMediaNavigate", new RestStreamHandler("POST", omuCapUrl, HandleObjectMediaNavigateMessage)); 162 "ObjectMediaNavigate",
163 new RestStreamHandler(
164 "POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString()));
161 } 165 }
162 } 166 }
163 167
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 899e5ea..be6b240 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -190,14 +190,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
190 { 190 {
191 //m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 191 //m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
192 string capsBase = "/CAPS/" + caps.CapsObjectPath; 192 string capsBase = "/CAPS/" + caps.CapsObjectPath;
193 caps.RegisterHandler("MapLayer", 193 caps.RegisterHandler(
194 new RestStreamHandler("POST", capsBase + m_mapLayerPath, 194 "MapLayer",
195 delegate(string request, string path, string param, 195 new RestStreamHandler(
196 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 196 "POST",
197 { 197 capsBase + m_mapLayerPath,
198 return MapLayerRequest(request, path, param, 198 (request, path, param, httpRequest, httpResponse)
199 agentID, caps); 199 => MapLayerRequest(request, path, param, agentID, caps),
200 })); 200 "MapLayer",
201 agentID.ToString()));
201 } 202 }
202 203
203 /// <summary> 204 /// <summary>
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
index 2f2b3e6..32e93b4 100644
--- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
+++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs
@@ -42,13 +42,13 @@ namespace OpenSim.Region.DataSnapshot
42{ 42{
43 public class DataRequestHandler 43 public class DataRequestHandler
44 { 44 {
45 private Scene m_scene = null; 45// private Scene m_scene = null;
46 private DataSnapshotManager m_externalData = null; 46 private DataSnapshotManager m_externalData = null;
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 public DataRequestHandler(Scene scene, DataSnapshotManager externalData) 49 public DataRequestHandler(Scene scene, DataSnapshotManager externalData)
50 { 50 {
51 m_scene = scene; 51// m_scene = scene;
52 m_externalData = externalData; 52 m_externalData = externalData;
53 53
54 //Register HTTP handler 54 //Register HTTP handler
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 6c5685c..1365831 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -48,16 +48,19 @@ namespace OpenSim.Region.Framework.Scenes
48{ 48{
49 public class RegionStatsHandler : IStreamedRequestHandler 49 public class RegionStatsHandler : IStreamedRequestHandler
50 { 50 {
51 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52
51 private string osRXStatsURI = String.Empty; 53 private string osRXStatsURI = String.Empty;
52 private string osXStatsURI = String.Empty; 54 private string osXStatsURI = String.Empty;
53 //private string osSecret = String.Empty; 55 //private string osSecret = String.Empty;
54 private OpenSim.Framework.RegionInfo regionInfo; 56 private OpenSim.Framework.RegionInfo regionInfo;
55 public string localZone = TimeZone.CurrentTimeZone.StandardName; 57 public string localZone = TimeZone.CurrentTimeZone.StandardName;
56 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); 58 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
57
58 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 59
60 public RegionStatsHandler(OpenSim.Framework.RegionInfo region_info) 60 public string Name { get { return "RegionStats"; } }
61 public string Description { get { return "Region Statistics"; } }
62
63 public RegionStatsHandler(RegionInfo region_info)
61 { 64 {
62 regionInfo = region_info; 65 regionInfo = region_info;
63 osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret); 66 osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index a190efe..141cf66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1417,13 +1417,19 @@ namespace OpenSim.Region.Framework.Scenes
1417 { 1417 {
1418 if (engine != null) 1418 if (engine != null)
1419 { 1419 {
1420// m_log.DebugFormat(
1421// "[PRIM INVENTORY]: Resuming script {0} {1} for {2}, OwnerChanged {3}",
1422// item.Name, item.ItemID, item.OwnerID, item.OwnerChanged);
1423
1424 engine.ResumeScript(item.ItemID);
1425
1420 if (item.OwnerChanged) 1426 if (item.OwnerChanged)
1421 engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); 1427 engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
1428
1422 item.OwnerChanged = false; 1429 item.OwnerChanged = false;
1423 engine.ResumeScript(item.ItemID);
1424 } 1430 }
1425 } 1431 }
1426 } 1432 }
1427 } 1433 }
1428 } 1434 }
1429} 1435} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 35c920b..5e275f6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1250,9 +1250,19 @@ namespace OpenSim.Region.Framework.Scenes
1250 1250
1251 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1251 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1252 MakeRootAgent(AbsolutePosition, flying); 1252 MakeRootAgent(AbsolutePosition, flying);
1253 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1254
1255// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1253 1256
1254 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1257 if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
1255 { 1258 {
1259 // We cannot sleep here since this would hold up the inbound packet processing thread, as
1260 // CompleteMovement() is executed synchronously. However, it might be better to delay the release
1261 // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete
1262 // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this
1263 // region as the current region, meaning that a close sent before then will fail the teleport.
1264// System.Threading.Thread.Sleep(2000);
1265
1256 m_log.DebugFormat( 1266 m_log.DebugFormat(
1257 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", 1267 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
1258 client.Name, client.AgentId, m_callbackURI); 1268 client.Name, client.AgentId, m_callbackURI);
@@ -1261,9 +1271,6 @@ namespace OpenSim.Region.Framework.Scenes
1261 m_callbackURI = null; 1271 m_callbackURI = null;
1262 } 1272 }
1263 1273
1264// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1265
1266 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1267 ValidateAndSendAppearanceAndAgentData(); 1274 ValidateAndSendAppearanceAndAgentData();
1268 1275
1269 // Create child agents in neighbouring regions 1276 // Create child agents in neighbouring regions
@@ -1278,7 +1285,6 @@ namespace OpenSim.Region.Framework.Scenes
1278 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 1285 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
1279 } 1286 }
1280 1287
1281
1282// m_log.DebugFormat( 1288// m_log.DebugFormat(
1283// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1289// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1284// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1290// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
@@ -3453,25 +3459,53 @@ namespace OpenSim.Region.Framework.Scenes
3453 } 3459 }
3454 } 3460 }
3455 3461
3456 RaiseCollisionScriptEvents(coldata); 3462 // Gods do not take damage and Invulnerable is set depending on parcel/region flags
3457 3463 if (Invulnerable || GodLevel > 0)
3458 if (Invulnerable)
3459 return; 3464 return;
3460 3465
3466 // The following may be better in the ICombatModule
3467 // probably tweaking of the values for ground and normal prim collisions will be needed
3461 float starthealth = Health; 3468 float starthealth = Health;
3462 uint killerObj = 0; 3469 uint killerObj = 0;
3470 SceneObjectPart part = null;
3463 foreach (uint localid in coldata.Keys) 3471 foreach (uint localid in coldata.Keys)
3464 { 3472 {
3465 SceneObjectPart part = Scene.GetSceneObjectPart(localid); 3473 if (localid == 0)
3466 3474 {
3467 if (part != null && part.ParentGroup.Damage != -1.0f) 3475 part = null;
3468 Health -= part.ParentGroup.Damage; 3476 }
3469 else 3477 else
3470 { 3478 {
3471 if (coldata[localid].PenetrationDepth >= 0.10f) 3479 part = Scene.GetSceneObjectPart(localid);
3480 }
3481 if (part != null)
3482 {
3483 // Ignore if it has been deleted or volume detect
3484 if (!part.ParentGroup.IsDeleted && !part.ParentGroup.IsVolumeDetect)
3485 {
3486 if (part.ParentGroup.Damage > 0.0f)
3487 {
3488 // Something with damage...
3489 Health -= part.ParentGroup.Damage;
3490 part.ParentGroup.Scene.DeleteSceneObject(part.ParentGroup, false);
3491 }
3492 else
3493 {
3494 // An ordinary prim
3495 if (coldata[localid].PenetrationDepth >= 0.10f)
3496 Health -= coldata[localid].PenetrationDepth * 5.0f;
3497 }
3498 }
3499 }
3500 else
3501 {
3502 // 0 is the ground
3503 // what about collisions with other avatars?
3504 if (localid == 0 && coldata[localid].PenetrationDepth >= 0.10f)
3472 Health -= coldata[localid].PenetrationDepth * 5.0f; 3505 Health -= coldata[localid].PenetrationDepth * 5.0f;
3473 } 3506 }
3474 3507
3508
3475 if (Health <= 0.0f) 3509 if (Health <= 0.0f)
3476 { 3510 {
3477 if (localid != 0) 3511 if (localid != 0)
@@ -3487,7 +3521,16 @@ namespace OpenSim.Region.Framework.Scenes
3487 ControllingClient.SendHealth(Health); 3521 ControllingClient.SendHealth(Health);
3488 } 3522 }
3489 if (Health <= 0) 3523 if (Health <= 0)
3524 {
3490 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 3525 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
3526 }
3527 if (starthealth == Health && Health < 100.0f)
3528 {
3529 Health += 0.03f;
3530 if (Health > 100.0f)
3531 Health = 100.0f;
3532 ControllingClient.SendHealth(Health);
3533 }
3491 } 3534 }
3492 } 3535 }
3493 3536
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 8af3652..6c53d95 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -306,30 +306,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
306 agentID, caps, scene.RegionInfo.RegionName); 306 agentID, caps, scene.RegionInfo.RegionName);
307 307
308 string capsBase = "/CAPS/" + caps.CapsObjectPath; 308 string capsBase = "/CAPS/" + caps.CapsObjectPath;
309 caps.RegisterHandler("ProvisionVoiceAccountRequest", 309 caps.RegisterHandler(
310 new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, 310 "ProvisionVoiceAccountRequest",
311 delegate(string request, string path, string param, 311 new RestStreamHandler(
312 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 312 "POST",
313 { 313 capsBase + m_provisionVoiceAccountRequestPath,
314 return ProvisionVoiceAccountRequest(scene, request, path, param, 314 (request, path, param, httpRequest, httpResponse)
315 agentID, caps); 315 => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps),
316 })); 316 "ProvisionVoiceAccountRequest",
317 caps.RegisterHandler("ParcelVoiceInfoRequest", 317 agentID.ToString()));
318 new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, 318
319 delegate(string request, string path, string param, 319 caps.RegisterHandler(
320 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 320 "ParcelVoiceInfoRequest",
321 { 321 new RestStreamHandler(
322 return ParcelVoiceInfoRequest(scene, request, path, param, 322 "POST",
323 agentID, caps); 323 capsBase + m_parcelVoiceInfoRequestPath,
324 })); 324 (request, path, param, httpRequest, httpResponse)
325 caps.RegisterHandler("ChatSessionRequest", 325 => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps),
326 new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, 326 "ParcelVoiceInfoRequest",
327 delegate(string request, string path, string param, 327 agentID.ToString()));
328 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 328
329 { 329 caps.RegisterHandler(
330 return ChatSessionRequest(scene, request, path, param, 330 "ChatSessionRequest",
331 agentID, caps); 331 new RestStreamHandler(
332 })); 332 "POST",
333 capsBase + m_chatSessionRequestPath,
334 (request, path, param, httpRequest, httpResponse)
335 => ChatSessionRequest(scene, request, path, param, agentID, caps),
336 "ChatSessionRequest",
337 agentID.ToString()));
333 } 338 }
334 339
335 /// <summary> 340 /// <summary>
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 4dbac1d..396d4c5 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -406,30 +406,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
406 m_log.DebugFormat("[VivoxVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 406 m_log.DebugFormat("[VivoxVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
407 407
408 string capsBase = "/CAPS/" + caps.CapsObjectPath; 408 string capsBase = "/CAPS/" + caps.CapsObjectPath;
409 caps.RegisterHandler("ProvisionVoiceAccountRequest", 409
410 new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, 410 caps.RegisterHandler(
411 delegate(string request, string path, string param, 411 "ProvisionVoiceAccountRequest",
412 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 412 new RestStreamHandler(
413 { 413 "POST",
414 return ProvisionVoiceAccountRequest(scene, request, path, param, 414 capsBase + m_provisionVoiceAccountRequestPath,
415 agentID, caps); 415 (request, path, param, httpRequest, httpResponse)
416 })); 416 => ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps),
417 caps.RegisterHandler("ParcelVoiceInfoRequest", 417 "ProvisionVoiceAccountRequest",
418 new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, 418 agentID.ToString()));
419 delegate(string request, string path, string param, 419
420 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 420 caps.RegisterHandler(
421 { 421 "ParcelVoiceInfoRequest",
422 return ParcelVoiceInfoRequest(scene, request, path, param, 422 new RestStreamHandler(
423 agentID, caps); 423 "POST",
424 })); 424 capsBase + m_parcelVoiceInfoRequestPath,
425 caps.RegisterHandler("ChatSessionRequest", 425 (request, path, param, httpRequest, httpResponse)
426 new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, 426 => ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps),
427 delegate(string request, string path, string param, 427 "ParcelVoiceInfoRequest",
428 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 428 agentID.ToString()));
429 { 429
430 return ChatSessionRequest(scene, request, path, param, 430 caps.RegisterHandler(
431 agentID, caps); 431 "ChatSessionRequest",
432 })); 432 new RestStreamHandler(
433 "POST",
434 capsBase + m_chatSessionRequestPath,
435 (request, path, param, httpRequest, httpResponse)
436 => ChatSessionRequest(scene, request, path, param, agentID, caps),
437 "ChatSessionRequest",
438 agentID.ToString()));
433 } 439 }
434 440
435 /// <summary> 441 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 2a2ef57..9208034 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7938,7 +7938,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7938 return; 7938 return;
7939 face = (int)rules.GetLSLIntegerItem(idx++); 7939 face = (int)rules.GetLSLIntegerItem(idx++);
7940 int shiny = (int)rules.GetLSLIntegerItem(idx++); 7940 int shiny = (int)rules.GetLSLIntegerItem(idx++);
7941 Bumpiness bump = (Bumpiness)Convert.ToByte((int)rules.GetLSLIntegerItem(idx++)); 7941 Bumpiness bump = (Bumpiness)(int)rules.GetLSLIntegerItem(idx++);
7942 7942
7943 SetShiny(part, face, shiny, bump); 7943 SetShiny(part, face, shiny, bump);
7944 7944
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 4248035..faf746f 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -282,14 +282,15 @@ namespace OpenSim.Region.UserStatistics
282// m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 282// m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
283 283
284 string capsPath = "/CAPS/VS/" + UUID.Random(); 284 string capsPath = "/CAPS/VS/" + UUID.Random();
285 caps.RegisterHandler("ViewerStats", 285 caps.RegisterHandler(
286 new RestStreamHandler("POST", capsPath, 286 "ViewerStats",
287 delegate(string request, string path, string param, 287 new RestStreamHandler(
288 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 288 "POST",
289 { 289 capsPath,
290 return ViewerStatsReport(request, path, param, 290 (request, path, param, httpRequest, httpResponse)
291 agentID, caps); 291 => ViewerStatsReport(request, path, param, agentID, caps),
292 })); 292 "ViewerStats",
293 agentID.ToString()));
293 } 294 }
294 295
295 private void OnDeRegisterCaps(UUID agentID, Caps caps) 296 private void OnDeRegisterCaps(UUID agentID, Caps caps)
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
index dfed761..18cef15 100644
--- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
@@ -191,6 +191,8 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
191 191
192 #endregion HTML 192 #endregion HTML
193 193
194 public string Name { get { return "OpenId"; } }
195 public string Description { get { return null; } }
194 public string ContentType { get { return m_contentType; } } 196 public string ContentType { get { return m_contentType; } }
195 public string HttpMethod { get { return m_httpMethod; } } 197 public string HttpMethod { get { return m_httpMethod; } }
196 public string Path { get { return m_path; } } 198 public string Path { get { return m_path; } }
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
index 59420f5..ef9b96f 100644
--- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
@@ -95,7 +95,8 @@ namespace OpenSim.Server.Handlers.Friends
95 return DeleteFriendString(request); 95 return DeleteFriendString(request);
96 96
97 } 97 }
98 m_log.DebugFormat("[FRIENDS HANDLER]: unknown method {0} request {1}", method.Length, method); 98
99 m_log.DebugFormat("[FRIENDS HANDLER]: unknown method request {0}", method);
99 } 100 }
100 catch (Exception e) 101 catch (Exception e)
101 { 102 {
@@ -103,7 +104,6 @@ namespace OpenSim.Server.Handlers.Friends
103 } 104 }
104 105
105 return FailureResult(); 106 return FailureResult();
106
107 } 107 }
108 108
109 #region Method-specific handlers 109 #region Method-specific handlers
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index bebf482..91d14cb 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -116,7 +116,7 @@ namespace OpenSim.Server.Handlers.Grid
116 return GetRegionFlags(request); 116 return GetRegionFlags(request);
117 } 117 }
118 118
119 m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); 119 m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method);
120 } 120 }
121 catch (Exception e) 121 catch (Exception e)
122 { 122 {
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
index 8ef03e7..c2f127c 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
@@ -122,7 +122,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
122 return GrantRights(request); 122 return GrantRights(request);
123 */ 123 */
124 } 124 }
125 m_log.DebugFormat("[HGFRIENDS HANDLER]: unknown method {0} request {1}", method.Length, method); 125
126 m_log.DebugFormat("[HGFRIENDS HANDLER]: unknown method {0}", method);
126 } 127 }
127 catch (Exception e) 128 catch (Exception e)
128 { 129 {
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 0e7a358..15156d0 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -52,6 +52,7 @@ namespace OpenSim.Services.InventoryService
52 : this(config, "InventoryService") 52 : this(config, "InventoryService")
53 { 53 {
54 } 54 }
55
55 public XInventoryService(IConfigSource config, string configName) : base(config) 56 public XInventoryService(IConfigSource config, string configName) : base(config)
56 { 57 {
57 if (configName != string.Empty) 58 if (configName != string.Empty)
@@ -364,6 +365,11 @@ namespace OpenSim.Services.InventoryService
364 // 365 //
365 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 366 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
366 { 367 {
368 return DeleteFolders(principalID, folderIDs, true);
369 }
370
371 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs, bool onlyIfTrash)
372 {
367 if (!m_AllowDelete) 373 if (!m_AllowDelete)
368 return false; 374 return false;
369 375
@@ -371,11 +377,12 @@ namespace OpenSim.Services.InventoryService
371 // 377 //
372 foreach (UUID id in folderIDs) 378 foreach (UUID id in folderIDs)
373 { 379 {
374 if (!ParentIsTrash(id)) 380 if (onlyIfTrash && !ParentIsTrash(id))
375 continue; 381 continue;
382 //m_log.InfoFormat("[XINVENTORY SERVICE]: Delete folder {0}", id);
376 InventoryFolderBase f = new InventoryFolderBase(); 383 InventoryFolderBase f = new InventoryFolderBase();
377 f.ID = id; 384 f.ID = id;
378 PurgeFolder(f); 385 PurgeFolder(f, onlyIfTrash);
379 m_Database.DeleteFolders("folderID", id.ToString()); 386 m_Database.DeleteFolders("folderID", id.ToString());
380 } 387 }
381 388
@@ -384,10 +391,15 @@ namespace OpenSim.Services.InventoryService
384 391
385 public virtual bool PurgeFolder(InventoryFolderBase folder) 392 public virtual bool PurgeFolder(InventoryFolderBase folder)
386 { 393 {
394 return PurgeFolder(folder, true);
395 }
396
397 public virtual bool PurgeFolder(InventoryFolderBase folder, bool onlyIfTrash)
398 {
387 if (!m_AllowDelete) 399 if (!m_AllowDelete)
388 return false; 400 return false;
389 401
390 if (!ParentIsTrash(folder.ID)) 402 if (onlyIfTrash && !ParentIsTrash(folder.ID))
391 return false; 403 return false;
392 404
393 XInventoryFolder[] subFolders = m_Database.GetFolders( 405 XInventoryFolder[] subFolders = m_Database.GetFolders(
@@ -396,7 +408,7 @@ namespace OpenSim.Services.InventoryService
396 408
397 foreach (XInventoryFolder x in subFolders) 409 foreach (XInventoryFolder x in subFolders)
398 { 410 {
399 PurgeFolder(ConvertToOpenSim(x)); 411 PurgeFolder(ConvertToOpenSim(x), onlyIfTrash);
400 m_Database.DeleteFolders("folderID", x.folderID.ToString()); 412 m_Database.DeleteFolders("folderID", x.folderID.ToString());
401 } 413 }
402 414
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 2953cb5..a4b3cbd 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -231,7 +231,8 @@ namespace OpenSim.Services.LLLoginService
231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, 233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency) 234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency,
235 string DSTZone)
235 : this() 236 : this()
236 { 237 {
237 FillOutInventoryData(invSkel, libService); 238 FillOutInventoryData(invSkel, libService);
@@ -260,7 +261,45 @@ namespace OpenSim.Services.LLLoginService
260 FillOutRegionData(destination); 261 FillOutRegionData(destination);
261 262
262 FillOutSeedCap(aCircuit, destination, clientIP); 263 FillOutSeedCap(aCircuit, destination, clientIP);
263 264
265 switch (DSTZone)
266 {
267 case "none":
268 DST = "N";
269 break;
270 case "local":
271 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
272 break;
273 default:
274 TimeZoneInfo dstTimeZone = null;
275 string[] tzList = DSTZone.Split(';');
276
277 foreach (string tzName in tzList)
278 {
279 try
280 {
281 dstTimeZone = TimeZoneInfo.FindSystemTimeZoneById(tzName);
282 }
283 catch
284 {
285 continue;
286 }
287 break;
288 }
289
290 if (dstTimeZone == null)
291 {
292 m_log.WarnFormat(
293 "[LLOGIN RESPONSE]: No valid timezone found for DST in {0}, falling back to system time.", tzList);
294 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
295 }
296 else
297 {
298 DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
299 }
300
301 break;
302 }
264 } 303 }
265 304
266 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService) 305 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService)
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 891c452..06e05a9 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -82,6 +82,8 @@ namespace OpenSim.Services.LLLoginService
82 protected string m_AllowedClients; 82 protected string m_AllowedClients;
83 protected string m_DeniedClients; 83 protected string m_DeniedClients;
84 84
85 protected string m_DSTZone;
86
85 IConfig m_LoginServerConfig; 87 IConfig m_LoginServerConfig;
86// IConfig m_ClientsConfig; 88// IConfig m_ClientsConfig;
87 89
@@ -118,6 +120,8 @@ namespace OpenSim.Services.LLLoginService
118 m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); 120 m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
119 m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); 121 m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);
120 122
123 m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time");
124
121 // Clean up some of these vars 125 // Clean up some of these vars
122 if (m_MapTileURL != String.Empty) 126 if (m_MapTileURL != String.Empty)
123 { 127 {
@@ -241,6 +245,7 @@ namespace OpenSim.Services.LLLoginService
241 245
242 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", 246 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}",
243 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); 247 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0);
248
244 try 249 try
245 { 250 {
246 // 251 //
@@ -423,8 +428,11 @@ namespace OpenSim.Services.LLLoginService
423 // 428 //
424 // Finally, fill out the response and return it 429 // Finally, fill out the response and return it
425 // 430 //
426 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 431 LLLoginResponse response
427 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency); 432 = new LLLoginResponse(
433 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
434 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP,
435 m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone);
428 436
429 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); 437 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
430 return response; 438 return response;
@@ -438,7 +446,10 @@ namespace OpenSim.Services.LLLoginService
438 } 446 }
439 } 447 }
440 448
441 protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) 449 protected GridRegion FindDestination(
450 UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation,
451 GridRegion home, out GridRegion gatekeeper,
452 out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags)
442 { 453 {
443 flags = TeleportFlags.ViaLogin; 454 flags = TeleportFlags.ViaLogin;
444 455