diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index c8e1e83..e053054 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 | ||
@@ -88,6 +90,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
88 | 90 | ||
89 | public void Initialise(IConfigSource source) | 91 | public void Initialise(IConfigSource source) |
90 | { | 92 | { |
93 | IConfig config = source.Configs["ClientStack.LindenCaps"]; | ||
94 | if (config != null) | ||
95 | m_Url = config.GetString("Cap_GetTexture", "localhost"); | ||
91 | } | 96 | } |
92 | 97 | ||
93 | public void AddRegion(Scene s) | 98 | public void AddRegion(Scene s) |
@@ -345,32 +350,38 @@ namespace OpenSim.Region.ClientStack.Linden | |||
345 | 350 | ||
346 | private void RegisterCaps(UUID agentID, Caps caps) | 351 | private void RegisterCaps(UUID agentID, Caps caps) |
347 | { | 352 | { |
348 | m_URL = "/CAPS/" + UUID.Random() + "/"; | 353 | if (m_Url == "localhost") |
349 | |||
350 | // Register this as a poll service | ||
351 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); | ||
352 | |||
353 | args.Type = PollServiceEventArgs.EventType.Texture; | ||
354 | MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args); | ||
355 | |||
356 | string hostName = m_scene.RegionInfo.ExternalHostName; | ||
357 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | ||
358 | string protocol = "http"; | ||
359 | |||
360 | if (MainServer.Instance.UseSSL) | ||
361 | { | 354 | { |
362 | hostName = MainServer.Instance.SSLCommonName; | 355 | string capUrl = "/CAPS/" + UUID.Random() + "/"; |
363 | port = MainServer.Instance.SSLPort; | ||
364 | protocol = "https"; | ||
365 | } | ||
366 | 356 | ||
367 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | 357 | // Register this as a poll service |
368 | if (handler != null) | 358 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); |
369 | handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL); | 359 | |
360 | args.Type = PollServiceEventArgs.EventType.Texture; | ||
361 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | ||
362 | |||
363 | string hostName = m_scene.RegionInfo.ExternalHostName; | ||
364 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | ||
365 | string protocol = "http"; | ||
366 | |||
367 | if (MainServer.Instance.UseSSL) | ||
368 | { | ||
369 | hostName = MainServer.Instance.SSLCommonName; | ||
370 | port = MainServer.Instance.SSLPort; | ||
371 | protocol = "https"; | ||
372 | } | ||
373 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | ||
374 | if (handler != null) | ||
375 | handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl); | ||
376 | else | ||
377 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
378 | m_pollservices[agentID] = args; | ||
379 | m_capsDict[agentID] = capUrl; | ||
380 | } | ||
370 | else | 381 | else |
371 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL)); | 382 | { |
372 | m_pollservices[agentID] = args; | 383 | caps.RegisterHandler("GetTexture", m_Url); |
373 | m_capsDict[agentID] = m_URL; | 384 | } |
374 | } | 385 | } |
375 | 386 | ||
376 | private void DeregisterCaps(UUID agentID, Caps caps) | 387 | private void DeregisterCaps(UUID agentID, Caps caps) |