diff options
author | Melanie | 2013-08-01 01:23:24 +0100 |
---|---|---|
committer | Melanie | 2013-08-01 01:23:24 +0100 |
commit | 21f5e670303ee978c747567e674e5ebe256ad2c7 (patch) | |
tree | 19c3740cbb8bf78d038e64b2fb66ea837cc8f724 /OpenSim/Region/ClientStack | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Include missing reference that probably stops windows build from commit 12995... (diff) | |
download | opensim-SC-21f5e670303ee978c747567e674e5ebe256ad2c7.zip opensim-SC-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.gz opensim-SC-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.bz2 opensim-SC-21f5e670303ee978c747567e674e5ebe256ad2c7.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
Diffstat (limited to 'OpenSim/Region/ClientStack')
3 files changed, 52 insertions, 38 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index c12b8d6..c8e1e83 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -82,6 +82,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
82 | 82 | ||
83 | private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>(); | 83 | private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>(); |
84 | 84 | ||
85 | private string m_URL; | ||
86 | |||
85 | #region ISharedRegionModule Members | 87 | #region ISharedRegionModule Members |
86 | 88 | ||
87 | public void Initialise(IConfigSource source) | 89 | public void Initialise(IConfigSource source) |
@@ -343,13 +345,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
343 | 345 | ||
344 | private void RegisterCaps(UUID agentID, Caps caps) | 346 | private void RegisterCaps(UUID agentID, Caps caps) |
345 | { | 347 | { |
346 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | 348 | m_URL = "/CAPS/" + UUID.Random() + "/"; |
347 | 349 | ||
348 | // Register this as a poll service | 350 | // Register this as a poll service |
349 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); | 351 | PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); |
350 | 352 | ||
351 | args.Type = PollServiceEventArgs.EventType.Texture; | 353 | args.Type = PollServiceEventArgs.EventType.Texture; |
352 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | 354 | MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args); |
353 | 355 | ||
354 | string hostName = m_scene.RegionInfo.ExternalHostName; | 356 | string hostName = m_scene.RegionInfo.ExternalHostName; |
355 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | 357 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; |
@@ -361,20 +363,23 @@ namespace OpenSim.Region.ClientStack.Linden | |||
361 | port = MainServer.Instance.SSLPort; | 363 | port = MainServer.Instance.SSLPort; |
362 | protocol = "https"; | 364 | protocol = "https"; |
363 | } | 365 | } |
364 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | 366 | |
367 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | ||
368 | if (handler != null) | ||
369 | handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL); | ||
370 | else | ||
371 | caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL)); | ||
365 | m_pollservices[agentID] = args; | 372 | m_pollservices[agentID] = args; |
366 | m_capsDict[agentID] = capUrl; | 373 | m_capsDict[agentID] = m_URL; |
367 | } | 374 | } |
368 | 375 | ||
369 | private void DeregisterCaps(UUID agentID, Caps caps) | 376 | private void DeregisterCaps(UUID agentID, Caps caps) |
370 | { | 377 | { |
371 | string capUrl; | ||
372 | PollServiceTextureEventArgs args; | 378 | PollServiceTextureEventArgs args; |
373 | if (m_capsDict.TryGetValue(agentID, out capUrl)) | 379 | |
374 | { | 380 | MainServer.Instance.RemoveHTTPHandler("", m_URL); |
375 | MainServer.Instance.RemoveHTTPHandler("", capUrl); | 381 | m_capsDict.Remove(agentID); |
376 | m_capsDict.Remove(agentID); | 382 | |
377 | } | ||
378 | if (m_pollservices.TryGetValue(agentID, out args)) | 383 | if (m_pollservices.TryGetValue(agentID, out args)) |
379 | { | 384 | { |
380 | m_pollservices.Remove(agentID); | 385 | m_pollservices.Remove(agentID); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 7d9f935..e4d8a20 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs | |||
@@ -68,7 +68,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
68 | /// </summary> | 68 | /// </summary> |
69 | private OSDMap m_features = new OSDMap(); | 69 | private OSDMap m_features = new OSDMap(); |
70 | 70 | ||
71 | private string m_MapImageServerURL = string.Empty; | ||
72 | private string m_SearchURL = string.Empty; | 71 | private string m_SearchURL = string.Empty; |
73 | private bool m_ExportSupported = false; | 72 | private bool m_ExportSupported = false; |
74 | 73 | ||
@@ -78,15 +77,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
78 | { | 77 | { |
79 | IConfig config = source.Configs["SimulatorFeatures"]; | 78 | IConfig config = source.Configs["SimulatorFeatures"]; |
80 | if (config != null) | 79 | if (config != null) |
81 | { | 80 | { |
82 | m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty); | ||
83 | if (m_MapImageServerURL != string.Empty) | ||
84 | { | ||
85 | m_MapImageServerURL = m_MapImageServerURL.Trim(); | ||
86 | if (!m_MapImageServerURL.EndsWith("/")) | ||
87 | m_MapImageServerURL = m_MapImageServerURL + "/"; | ||
88 | } | ||
89 | |||
90 | m_SearchURL = config.GetString("SearchServerURI", string.Empty); | 81 | m_SearchURL = config.GetString("SearchServerURI", string.Empty); |
91 | 82 | ||
92 | m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported); | 83 | m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported); |
@@ -149,15 +140,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
149 | m_features["PhysicsShapeTypes"] = typesMap; | 140 | m_features["PhysicsShapeTypes"] = typesMap; |
150 | 141 | ||
151 | // Extra information for viewers that want to use it | 142 | // Extra information for viewers that want to use it |
152 | OSDMap gridServicesMap = new OSDMap(); | 143 | // TODO: Take these out of here into their respective modules, like map-server-url |
153 | if (m_MapImageServerURL != string.Empty) | 144 | OSDMap extrasMap = new OSDMap(); |
154 | gridServicesMap["map-server-url"] = m_MapImageServerURL; | ||
155 | if (m_SearchURL != string.Empty) | 145 | if (m_SearchURL != string.Empty) |
156 | gridServicesMap["search"] = m_SearchURL; | 146 | extrasMap["search-server-url"] = m_SearchURL; |
157 | m_features["GridServices"] = gridServicesMap; | ||
158 | |||
159 | if (m_ExportSupported) | 147 | if (m_ExportSupported) |
160 | m_features["ExportSupported"] = true; | 148 | extrasMap["ExportSupported"] = true; |
149 | |||
150 | if (extrasMap.Count > 0) | ||
151 | m_features["OpenSimExtras"] = extrasMap; | ||
152 | |||
161 | } | 153 | } |
162 | } | 154 | } |
163 | 155 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 544b54b..2a2c819 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -69,9 +69,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
69 | 69 | ||
70 | StatsManager.RegisterStat( | 70 | StatsManager.RegisterStat( |
71 | new Stat( | 71 | new Stat( |
72 | "ClientLogoutsDueToNoReceives", | ||
73 | "Number of times a client has been logged out because no packets were received before the timeout.", | ||
74 | "", | ||
75 | "", | ||
76 | "clientstack", | ||
77 | scene.Name, | ||
78 | StatType.Pull, | ||
79 | MeasuresOfInterest.None, | ||
80 | stat => stat.Value = m_udpServer.ClientLogoutsDueToNoReceives, | ||
81 | StatVerbosity.Debug)); | ||
82 | |||
83 | StatsManager.RegisterStat( | ||
84 | new Stat( | ||
72 | "IncomingUDPReceivesCount", | 85 | "IncomingUDPReceivesCount", |
73 | "Number of UDP receives performed", | 86 | "Number of UDP receives performed", |
74 | "Number of UDP receives performed", | 87 | "", |
75 | "", | 88 | "", |
76 | "clientstack", | 89 | "clientstack", |
77 | scene.Name, | 90 | scene.Name, |
@@ -84,7 +97,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
84 | new Stat( | 97 | new Stat( |
85 | "IncomingPacketsProcessedCount", | 98 | "IncomingPacketsProcessedCount", |
86 | "Number of inbound LL protocol packets processed", | 99 | "Number of inbound LL protocol packets processed", |
87 | "Number of inbound LL protocol packets processed", | 100 | "", |
88 | "", | 101 | "", |
89 | "clientstack", | 102 | "clientstack", |
90 | scene.Name, | 103 | scene.Name, |
@@ -97,7 +110,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
97 | new Stat( | 110 | new Stat( |
98 | "OutgoingUDPSendsCount", | 111 | "OutgoingUDPSendsCount", |
99 | "Number of UDP sends performed", | 112 | "Number of UDP sends performed", |
100 | "Number of UDP sends performed", | 113 | "", |
101 | "", | 114 | "", |
102 | "clientstack", | 115 | "clientstack", |
103 | scene.Name, | 116 | scene.Name, |
@@ -149,6 +162,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | /// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary> | 162 | /// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary> |
150 | public const int MTU = 1400; | 163 | public const int MTU = 1400; |
151 | 164 | ||
165 | /// <summary>Number of forced client logouts due to no receipt of packets before timeout.</summary> | ||
166 | public int ClientLogoutsDueToNoReceives { get; private set; } | ||
167 | |||
152 | /// <summary> | 168 | /// <summary> |
153 | /// Default packet debug level given to new clients | 169 | /// Default packet debug level given to new clients |
154 | /// </summary> | 170 | /// </summary> |
@@ -1058,7 +1074,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1058 | // Fire this out on a different thread so that we don't hold up outgoing packet processing for | 1074 | // Fire this out on a different thread so that we don't hold up outgoing packet processing for |
1059 | // everybody else if this is being called due to an ack timeout. | 1075 | // everybody else if this is being called due to an ack timeout. |
1060 | // This is the same as processing as the async process of a logout request. | 1076 | // This is the same as processing as the async process of a logout request. |
1061 | Util.FireAndForget(o => DeactivateClientDueToTimeout(client)); | 1077 | Util.FireAndForget(o => DeactivateClientDueToTimeout(client, timeoutTicks)); |
1062 | 1078 | ||
1063 | return; | 1079 | return; |
1064 | } | 1080 | } |
@@ -1842,18 +1858,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1842 | /// regular client pings. | 1858 | /// regular client pings. |
1843 | /// </remarks> | 1859 | /// </remarks> |
1844 | /// <param name='client'></param> | 1860 | /// <param name='client'></param> |
1845 | private void DeactivateClientDueToTimeout(LLClientView client) | 1861 | /// <param name='timeoutTicks'></param> |
1862 | private void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks) | ||
1846 | { | 1863 | { |
1847 | lock (client.CloseSyncLock) | 1864 | lock (client.CloseSyncLock) |
1848 | { | 1865 | { |
1866 | ClientLogoutsDueToNoReceives++; | ||
1867 | |||
1849 | m_log.WarnFormat( | 1868 | m_log.WarnFormat( |
1850 | "[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2}", | 1869 | "[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}. Disconnecting.", |
1851 | client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.RegionInfo.RegionName); | 1870 | client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, m_scene.Name); |
1852 | |||
1853 | StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); | ||
1854 | 1871 | ||
1855 | if (!client.SceneAgent.IsChildAgent) | 1872 | if (!client.SceneAgent.IsChildAgent) |
1856 | client.Kick("Simulator logged you out due to connection timeout"); | 1873 | client.Kick("Simulator logged you out due to connection timeout."); |
1857 | 1874 | ||
1858 | client.CloseWithoutChecks(true); | 1875 | client.CloseWithoutChecks(true); |
1859 | } | 1876 | } |