diff options
author | Diva Canto | 2011-05-02 08:48:55 -0700 |
---|---|---|
committer | Diva Canto | 2011-05-02 08:48:55 -0700 |
commit | 10180760b741edf22cec23db0ec490669407425f (patch) | |
tree | 66f52dc38657213e03470aab161a0d2ffa3fffe6 /OpenSim/Capabilities/Handlers | |
parent | Start to drill down on GetTexture. Read the config and do different things. (diff) | |
download | opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.zip opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.gz opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.bz2 opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.xz |
Works!
Diffstat (limited to 'OpenSim/Capabilities/Handlers')
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetTextureHandler.cs | 3 | ||||
-rw-r--r-- | OpenSim/Capabilities/Handlers/GetTextureServerConnector.cs (renamed from OpenSim/Capabilities/Handlers/CapsServerConnector.cs) | 12 |
2 files changed, 6 insertions, 9 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTextureHandler.cs index 00186ee..00ff3d0 100644 --- a/OpenSim/Capabilities/Handlers/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTextureHandler.cs | |||
@@ -67,13 +67,14 @@ namespace OpenSim.Capabilities.Handlers | |||
67 | 67 | ||
68 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 68 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
69 | { | 69 | { |
70 | //m_log.DebugFormat("[GETTEXTURE]: called in {0}", m_scene.RegionInfo.RegionName); | ||
71 | 70 | ||
72 | // Try to parse the texture ID from the request URL | 71 | // Try to parse the texture ID from the request URL |
73 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 72 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
74 | string textureStr = query.GetOne("texture_id"); | 73 | string textureStr = query.GetOne("texture_id"); |
75 | string format = query.GetOne("format"); | 74 | string format = query.GetOne("format"); |
76 | 75 | ||
76 | m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr); | ||
77 | |||
77 | if (m_assetService == null) | 78 | if (m_assetService == null) |
78 | { | 79 | { |
79 | m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service"); | 80 | m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service"); |
diff --git a/OpenSim/Capabilities/Handlers/CapsServerConnector.cs b/OpenSim/Capabilities/Handlers/GetTextureServerConnector.cs index 561d767..0335eac 100644 --- a/OpenSim/Capabilities/Handlers/CapsServerConnector.cs +++ b/OpenSim/Capabilities/Handlers/GetTextureServerConnector.cs | |||
@@ -32,16 +32,15 @@ using OpenSim.Services.Interfaces; | |||
32 | using OpenSim.Framework.Servers.HttpServer; | 32 | using OpenSim.Framework.Servers.HttpServer; |
33 | using OpenSim.Server.Handlers.Base; | 33 | using OpenSim.Server.Handlers.Base; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
36 | 35 | ||
37 | namespace OpenSim.Capabilities.Handlers | 36 | namespace OpenSim.Capabilities.Handlers |
38 | { | 37 | { |
39 | public class CapsServerConnector : ServiceConnector | 38 | public class GetTextureServerConnector : ServiceConnector |
40 | { | 39 | { |
41 | private IAssetService m_AssetService; | 40 | private IAssetService m_AssetService; |
42 | private string m_ConfigName = "CapsService"; | 41 | private string m_ConfigName = "CapsService"; |
43 | 42 | ||
44 | public CapsServerConnector(IConfigSource config, IHttpServer server, string configName) : | 43 | public GetTextureServerConnector(IConfigSource config, IHttpServer server, string configName) : |
45 | base(config, server, configName) | 44 | base(config, server, configName) |
46 | { | 45 | { |
47 | if (configName != String.Empty) | 46 | if (configName != String.Empty) |
@@ -51,11 +50,10 @@ namespace OpenSim.Capabilities.Handlers | |||
51 | if (serverConfig == null) | 50 | if (serverConfig == null) |
52 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); | 51 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); |
53 | 52 | ||
54 | string assetService = serverConfig.GetString("LocalServiceModule", | 53 | string assetService = serverConfig.GetString("AssetService", String.Empty); |
55 | String.Empty); | ||
56 | 54 | ||
57 | if (assetService == String.Empty) | 55 | if (assetService == String.Empty) |
58 | throw new Exception("No LocalServiceModule in config file"); | 56 | throw new Exception("No AssetService in config file"); |
59 | 57 | ||
60 | Object[] args = new Object[] { config }; | 58 | Object[] args = new Object[] { config }; |
61 | m_AssetService = | 59 | m_AssetService = |
@@ -64,8 +62,6 @@ namespace OpenSim.Capabilities.Handlers | |||
64 | if (m_AssetService == null) | 62 | if (m_AssetService == null) |
65 | 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)); |
66 | 64 | ||
67 | bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false); | ||
68 | |||
69 | server.AddStreamHandler(new GetTextureHandler("/CAPS/" + UUID.Random() + "/", m_AssetService)); | 65 | server.AddStreamHandler(new GetTextureHandler("/CAPS/" + UUID.Random() + "/", m_AssetService)); |
70 | } | 66 | } |
71 | 67 | ||