aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-05-25 10:23:52 +0100
committerUbitUmarov2017-05-25 10:23:52 +0100
commit27779953315e160067080b6f17945ab54695d63f (patch)
tree36e66eeaf84fd48382ab89278c7b150723a45235 /OpenSim/Region
parent merge master (diff)
parentadd some checks for valid endpoints (diff)
downloadopensim-SC-27779953315e160067080b6f17945ab54695d63f.zip
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.gz
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.bz2
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/Application.cs2
-rw-r--r--OpenSim/Region/Application/OpenSim.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs13
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs15
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs52
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs5
-rwxr-xr-xOpenSim/Region/ScriptEngine/XEngine/XEngine.cs1
8 files changed, 55 insertions, 44 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 4bd2c28..447afb4 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -79,7 +79,7 @@ namespace OpenSim
79 else 79 else
80 { 80 {
81 ServicePointManager.DefaultConnectionLimit = 12; 81 ServicePointManager.DefaultConnectionLimit = 12;
82 try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case crazy some mono decides to have it infinity 82 try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some crazy mono decides to have it infinity
83 catch { } 83 catch { }
84 } 84 }
85 85
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 524f2be..5977f40 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -143,7 +143,7 @@ namespace OpenSim
143 //Mono.Unix.Native.Signum signal = signals [index].Signum; 143 //Mono.Unix.Native.Signum signal = signals [index].Signum;
144 MainConsole.Instance.RunCommand("shutdown"); 144 MainConsole.Instance.RunCommand("shutdown");
145 } 145 }
146 }); 146 });
147#endif 147#endif
148 148
149 /// <summary> 149 /// <summary>
@@ -165,6 +165,7 @@ namespace OpenSim
165 { 165 {
166 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) 166 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
167 }; 167 };
168 signal_thread.IsBackground = true;
168 signal_thread.Start(); 169 signal_thread.Start();
169 } 170 }
170 catch (Exception e) 171 catch (Exception e)
@@ -485,6 +486,12 @@ namespace OpenSim
485 RunCommandScript(m_shutdownCommandsFile); 486 RunCommandScript(m_shutdownCommandsFile);
486 } 487 }
487 488
489 if (m_timedScript != "disabled")
490 {
491 m_scriptTimer.Dispose();
492 m_timedScript = "disabled";
493 }
494
488 base.ShutdownSpecific(); 495 base.ShutdownSpecific();
489 } 496 }
490 497
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index f733972..27db72c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -88,8 +88,8 @@ namespace OpenSim.Region.ClientStack.Linden
88 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); 88 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
89 private static Thread[] m_workerThreads = null; 89 private static Thread[] m_workerThreads = null;
90 private static int m_NumberScenes = 0; 90 private static int m_NumberScenes = 0;
91 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 91 private static OpenSim.Framework.BlockingQueue<aPollRequest> m_queue =
92 new OpenMetaverse.BlockingQueue<aPollRequest>(); 92 new OpenSim.Framework.BlockingQueue<aPollRequest>();
93 93
94 private Dictionary<UUID, PollServiceMeshEventArgs> m_pollservices = new Dictionary<UUID, PollServiceMeshEventArgs>(); 94 private Dictionary<UUID, PollServiceMeshEventArgs> m_pollservices = new Dictionary<UUID, PollServiceMeshEventArgs>();
95 95
@@ -170,7 +170,7 @@ namespace OpenSim.Region.ClientStack.Linden
170 m_workerThreads[i] = WorkManager.StartThread(DoMeshRequests, 170 m_workerThreads[i] = WorkManager.StartThread(DoMeshRequests,
171 String.Format("GetMeshWorker{0}", i), 171 String.Format("GetMeshWorker{0}", i),
172 ThreadPriority.Normal, 172 ThreadPriority.Normal,
173 false, 173 true,
174 false, 174 false,
175 null, 175 null,
176 int.MaxValue); 176 int.MaxValue);
@@ -203,9 +203,12 @@ namespace OpenSim.Region.ClientStack.Linden
203 { 203 {
204 while(true) 204 while(true)
205 { 205 {
206 aPollRequest poolreq = m_queue.Dequeue(); 206 aPollRequest poolreq = m_queue.Dequeue(1000);
207 if(m_NumberScenes <= 0)
208 return;
207 Watchdog.UpdateThread(); 209 Watchdog.UpdateThread();
208 poolreq.thepoll.Process(poolreq); 210 if(poolreq.reqID != UUID.Zero)
211 poolreq.thepoll.Process(poolreq);
209 } 212 }
210 } 213 }
211 214
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index c9f3b7e..d6b4873 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -77,8 +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 private static int m_NumberScenes = 0; 79 private static int m_NumberScenes = 0;
80 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 80 private static OpenSim.Framework.BlockingQueue<aPollRequest> m_queue =
81 new OpenMetaverse.BlockingQueue<aPollRequest>(); 81 new OpenSim.Framework.BlockingQueue<aPollRequest>();
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
@@ -139,7 +139,7 @@ namespace OpenSim.Region.ClientStack.Linden
139 m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests, 139 m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests,
140 String.Format("GetTextureWorker{0}", i), 140 String.Format("GetTextureWorker{0}", i),
141 ThreadPriority.Normal, 141 ThreadPriority.Normal,
142 false, 142 true,
143 false, 143 false,
144 null, 144 null,
145 int.MaxValue); 145 int.MaxValue);
@@ -274,7 +274,7 @@ namespace OpenSim.Region.ClientStack.Linden
274 { 274 {
275 if (responses.Count > 0) 275 if (responses.Count > 0)
276 { 276 {
277 if (m_queue.Count >= 4) 277 if (m_queue.Count() >= 4)
278 { 278 {
279 // Never allow more than 4 fetches to wait 279 // Never allow more than 4 fetches to wait
280 reqinfo.send503 = true; 280 reqinfo.send503 = true;
@@ -445,9 +445,12 @@ namespace OpenSim.Region.ClientStack.Linden
445 { 445 {
446 while (true) 446 while (true)
447 { 447 {
448 aPollRequest poolreq = m_queue.Dequeue(); 448 aPollRequest poolreq = m_queue.Dequeue(2000);
449 if(m_NumberScenes <= 0)
450 return;
449 Watchdog.UpdateThread(); 451 Watchdog.UpdateThread();
450 poolreq.thepoll.Process(poolreq); 452 if(poolreq.reqID != UUID.Zero)
453 poolreq.thepoll.Process(poolreq);
451 } 454 }
452 } 455 }
453 456
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 1ea0454..422c354 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -206,7 +206,7 @@ namespace OpenSim.Region.ClientStack.Linden
206 m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests, 206 m_workerThreads[i] = WorkManager.StartThread(DoInventoryRequests,
207 String.Format("InventoryWorkerThread{0}", i), 207 String.Format("InventoryWorkerThread{0}", i),
208 ThreadPriority.Normal, 208 ThreadPriority.Normal,
209 false, 209 true,
210 true, 210 true,
211 null, 211 null,
212 int.MaxValue); 212 int.MaxValue);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 4b846f5..ca20604 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -527,15 +527,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
527 { 527 {
528 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); 528 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
529 529
530 string message; 530 string reason = String.Empty;
531 finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message); 531 finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out reason);
532 532
533 if (finalDestination == null) 533 if (finalDestination == null)
534 { 534 {
535 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}", 535 m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}",
536 LogHeader, sp.Name, sp.UUID, message); 536 LogHeader, sp.Name, sp.UUID, reason);
537 537
538 sp.ControllingClient.SendTeleportFailed(message); 538 sp.ControllingClient.SendTeleportFailed(reason);
539 return; 539 return;
540 } 540 }
541 541
@@ -548,17 +548,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
548 return; 548 return;
549 } 549 }
550 550
551 // Validate assorted conditions
552 string reason = string.Empty;
553 if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason)) 551 if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason))
554 { 552 {
555 sp.ControllingClient.SendTeleportFailed(reason); 553 sp.ControllingClient.SendTeleportFailed(reason);
556 return; 554 return;
557 } 555 }
558 556
559 if (message != null)
560 sp.ControllingClient.SendAgentAlertMessage(message, true);
561
562 // 557 //
563 // This is it 558 // This is it
564 // 559 //
@@ -735,8 +730,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
735 IPEndPoint endPoint = finalDestination.ExternalEndPoint; 730 IPEndPoint endPoint = finalDestination.ExternalEndPoint;
736 if (endPoint == null || endPoint.Address == null) 731 if (endPoint == null || endPoint.Address == null)
737 { 732 {
738 sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down"); 733 sp.ControllingClient.SendTeleportFailed("Could not resolve destination Address");
739
740 return; 734 return;
741 } 735 }
742 736
@@ -784,22 +778,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
784 // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to 778 // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to
785 // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). 779 // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested).
786 sp.ControllingClient.SendTeleportStart(teleportFlags); 780 sp.ControllingClient.SendTeleportStart(teleportFlags);
787 781
788 // the avatar.Close below will clear the child region list. We need this below for (possibly)
789 // closing the child agents, so save it here (we need a copy as it is Clear()-ed).
790 //List<ulong> childRegions = avatar.KnownRegionHandles;
791 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport
792 // failure at this point (unlike a border crossing failure). So perhaps this can never fail
793 // once we reach here...
794 //avatar.Scene.RemoveCapsHandler(avatar.UUID);
795
796 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 782 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
797 AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); 783 AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo();
798 agentCircuit.startpos = position; 784 agentCircuit.startpos = position;
799 agentCircuit.child = true; 785 agentCircuit.child = true;
800 786
801// agentCircuit.Appearance = sp.Appearance;
802// agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false);
803 agentCircuit.Appearance = new AvatarAppearance(); 787 agentCircuit.Appearance = new AvatarAppearance();
804 agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; 788 agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
805 789
@@ -1673,6 +1657,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1673 return agent; 1657 return agent;
1674 } 1658 }
1675 1659
1660 IPEndPoint endpoint = neighbourRegion.ExternalEndPoint;
1661 if(endpoint == null)
1662 {
1663 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: failed to resolve neighbour address {0} ",neighbourRegion.ExternalHostName);
1664 return agent;
1665 }
1666
1676 m_entityTransferStateMachine.SetInTransit(agent.UUID); 1667 m_entityTransferStateMachine.SetInTransit(agent.UUID);
1677 agent.RemoveFromPhysicalScene(); 1668 agent.RemoveFromPhysicalScene();
1678 1669
@@ -1683,7 +1674,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1683 return agent; 1674 return agent;
1684 } 1675 }
1685 1676
1686 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx); 1677 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, endpoint, isFlying, ctx);
1687 } 1678 }
1688 catch (Exception e) 1679 catch (Exception e)
1689 { 1680 {
@@ -1727,6 +1718,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1727 agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath); 1718 agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath);
1728 1719
1729 IPEndPoint endPoint = neighbourRegion.ExternalEndPoint; 1720 IPEndPoint endPoint = neighbourRegion.ExternalEndPoint;
1721 if(endPoint == null)
1722 {
1723 m_log.DebugFormat("CrossAgentCreateFarChild failed to resolve neighbour address {0}", neighbourRegion.ExternalHostName);
1724 return false;
1725 }
1730 if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason)) 1726 if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason))
1731 { 1727 {
1732 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 1728 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
@@ -1821,7 +1817,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1821 } 1817 }
1822 1818
1823 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, 1819 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
1824 bool isFlying, EntityTransferContext ctx) 1820 IPEndPoint endpoint, bool isFlying, EntityTransferContext ctx)
1825 { 1821 {
1826 1822
1827 string agentcaps; 1823 string agentcaps;
@@ -1848,15 +1844,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1848 { 1844 {
1849 m_eqModule.CrossRegion( 1845 m_eqModule.CrossRegion(
1850 neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */, 1846 neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */,
1851 neighbourRegion.ExternalEndPoint, 1847 endpoint, capsPath, agent.UUID, agent.ControllingClient.SessionId,
1852 capsPath, agent.UUID, agent.ControllingClient.SessionId,
1853 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); 1848 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
1854 } 1849 }
1855 else 1850 else
1856 { 1851 {
1857 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); 1852 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
1858 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1853 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity,
1859 capsPath); 1854 endpoint,capsPath);
1860 } 1855 }
1861 1856
1862 // SUCCESS! 1857 // SUCCESS!
@@ -1953,7 +1948,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1953 1948
1954 seeds.Add(regionhandler, agent.CapsPath); 1949 seeds.Add(regionhandler, agent.CapsPath);
1955 1950
1956
1957// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); 1951// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
1958 agent.ChildrenCapSeeds = null; 1952 agent.ChildrenCapSeeds = null;
1959 1953
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index eb6455a..1688aa6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -188,9 +188,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
188 cmdHandlerThreadCycleSleepms = 100; 188 cmdHandlerThreadCycleSleepms = 100;
189 } 189 }
190 190
191/*
191 ~AsyncCommandManager() 192 ~AsyncCommandManager()
192 { 193 {
193 // Shut down thread 194 // Shut down thread
195
194 try 196 try
195 { 197 {
196 lock (staticLock) 198 lock (staticLock)
@@ -213,7 +215,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
213 { 215 {
214 } 216 }
215 } 217 }
216 218*/
217 /// <summary> 219 /// <summary>
218 /// Main loop for the manager thread 220 /// Main loop for the manager thread
219 /// </summary> 221 /// </summary>
@@ -229,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
229 231
230 Watchdog.UpdateThread(); 232 Watchdog.UpdateThread();
231 } 233 }
234 catch ( System.Threading.ThreadAbortException) { }
232 catch (Exception e) 235 catch (Exception e)
233 { 236 {
234 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e); 237 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 2e39033..c1abba2 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1079,6 +1079,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1079 "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); 1079 "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name);
1080 } 1080 }
1081 } 1081 }
1082 catch (System.Threading.ThreadAbortException) { }
1082 catch (Exception e) 1083 catch (Exception e)
1083 { 1084 {
1084 m_log.Error( 1085 m_log.Error(