aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers/GetTexture
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Capabilities/Handlers/GetTexture')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs7
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs4
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs3
3 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index f3efb53..a8e0fb5 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -56,9 +56,16 @@ namespace OpenSim.Capabilities.Handlers
56 56
57 public const string DefaultFormat = "x-j2c"; 57 public const string DefaultFormat = "x-j2c";
58 58
59 // TODO: Change this to a config option
60 private string m_RedirectURL = null;
61
62
59 public GetTextureHandler(IAssetService assService) 63 public GetTextureHandler(IAssetService assService)
60 { 64 {
61 m_assetService = assService; 65 m_assetService = assService;
66 m_RedirectURL = redirectURL;
67 if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/"))
68 m_RedirectURL += "/";
62 } 69 }
63 70
64 public Hashtable Handle(Hashtable request) 71 public Hashtable Handle(Hashtable request)
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
index bf66acb..d55e0ff 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureServerConnector.cs
@@ -63,8 +63,10 @@ namespace OpenSim.Capabilities.Handlers
63 if (m_AssetService == null) 63 if (m_AssetService == null)
64 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName)); 64 throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
65 65
66 string rurl = serverConfig.GetString("GetTextureRedirectURL");
67 ;
66 server.AddStreamHandler( 68 server.AddStreamHandler(
67 new GetTextureHandler("/CAPS/GetTexture/", m_AssetService, "GetTexture", null)); 69 new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null, rurl));
68 } 70 }
69 } 71 }
70} 72}
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index 217a265..61aa689 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Framework;
37using OpenSim.Framework.Servers.HttpServer; 37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Tests.Common; 39using OpenSim.Tests.Common;
40using OpenSim.Tests.Common.Mock;
41 40
42/* 41/*
43namespace OpenSim.Capabilities.Handlers.GetTexture.Tests 42namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
@@ -53,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
53 // 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.
54 Scene scene = new SceneHelpers().SetupScene(); 53 Scene scene = new SceneHelpers().SetupScene();
55 54
56 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null); 55 GetTextureHandler handler = new GetTextureHandler("/gettexture", scene.AssetService, "TestGetTexture", null, null);
57 TestOSHttpRequest req = new TestOSHttpRequest(); 56 TestOSHttpRequest req = new TestOSHttpRequest();
58 TestOSHttpResponse resp = new TestOSHttpResponse(); 57 TestOSHttpResponse resp = new TestOSHttpResponse();
59 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");