diff options
Add support for simple external CAPS texture services
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index a42c96c..0570144 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -77,6 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
77 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); | 77 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); |
78 | private static Thread[] m_workerThreads = null; | 78 | private static Thread[] m_workerThreads = null; |
79 | 79 | ||
80 | private string m_Url = "localhost"; | ||
81 | |||
80 | private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = | 82 | private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = |
81 | new OpenMetaverse.BlockingQueue<aPollRequest>(); | 83 | new OpenMetaverse.BlockingQueue<aPollRequest>(); |
82 | 84 | ||
@@ -86,6 +88,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
86 | 88 | ||
87 | public void Initialise(IConfigSource source) | 89 | public void Initialise(IConfigSource source) |
88 | { | 90 | { |
91 | IConfig config = source.Configs["ClientStack.LindenCaps"]; | ||
92 | if (config != null) | ||
93 | m_Url = config.GetString("Cap_GetTexture", "localhost"); | ||
89 | } | 94 | } |
90 | 95 | ||
91 | public void AddRegion(Scene s) | 96 | public void AddRegion(Scene s) |
@@ -343,27 +348,34 @@ namespace OpenSim.Region.ClientStack.Linden | |||
343 | 348 | ||
344 | private void RegisterCaps(UUID agentID, Caps caps) | 349 | private void RegisterCaps(UUID agentID, Caps caps) |
345 | { | 350 | { |
346 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | 351 | if (m_Url == "localhost") |
347 | 352 | { | |
348 | // Register this as a poll service | 353 | string capUrl = "/CAPS/" + UUID.Random() + "/"; |
349 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); | 354 | |
350 | 355 | // Register this as a poll service | |
351 | args.Type = PollServiceEventArgs.EventType.Texture; | 356 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); |
352 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | 357 | |
353 | 358 | args.Type = PollServiceEventArgs.EventType.Texture; | |
354 | string hostName = m_scene.RegionInfo.ExternalHostName; | 359 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); |
355 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | 360 | |
356 | string protocol = "http"; | 361 | string hostName = m_scene.RegionInfo.ExternalHostName; |
357 | 362 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | |
358 | if (MainServer.Instance.UseSSL) | 363 | string protocol = "http"; |
364 | |||
365 | if (MainServer.Instance.UseSSL) | ||
366 | { | ||
367 | hostName = MainServer.Instance.SSLCommonName; | ||
368 | port = MainServer.Instance.SSLPort; | ||
369 | protocol = "https"; | ||
370 | } | ||
371 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
372 | m_pollservices[agentID] = args; | ||
373 | m_capsDict[agentID] = capUrl; | ||
374 | } | ||
375 | else | ||
359 | { | 376 | { |
360 | hostName = MainServer.Instance.SSLCommonName; | 377 | caps.RegisterHandler("GetTexture", m_Url); |
361 | port = MainServer.Instance.SSLPort; | ||
362 | protocol = "https"; | ||
363 | } | 378 | } |
364 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
365 | m_pollservices[agentID] = args; | ||
366 | m_capsDict[agentID] = capUrl; | ||
367 | } | 379 | } |
368 | 380 | ||
369 | private void DeregisterCaps(UUID agentID, Caps caps) | 381 | private void DeregisterCaps(UUID agentID, Caps caps) |