diff options
author | Justin Clark-Casey (justincc) | 2012-05-03 01:45:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-03 01:45:49 +0100 |
commit | 231a3bf147315a9284140476d2b09e13c3fee1c0 (patch) | |
tree | f04ffb5bb43d919c1687af57e4cb48829f6dc437 /OpenSim/Capabilities/Handlers | |
parent | Comment out the five second sleep in etm.DoTeleport() if the old agent needs ... (diff) | |
download | opensim-SC-231a3bf147315a9284140476d2b09e13c3fee1c0.zip opensim-SC-231a3bf147315a9284140476d2b09e13c3fee1c0.tar.gz opensim-SC-231a3bf147315a9284140476d2b09e13c3fee1c0.tar.bz2 opensim-SC-231a3bf147315a9284140476d2b09e13c3fee1c0.tar.xz |
Implement optional name and description on http stream handlers so that we can relate a slow request to what the handler actually does and the agent it serves, if applicable.
This is most useful for capabilities where the url is not self-describing.
Diffstat (limited to 'OpenSim/Capabilities/Handlers')
7 files changed, 25 insertions, 17 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 | ||