diff options
author | diva | 2008-12-20 18:15:02 +0000 |
---|---|---|
committer | diva | 2008-12-20 18:15:02 +0000 |
commit | fcf61c4d0db38e39e1db9e54602290ab0f1f1204 (patch) | |
tree | b78984fd248e59bc084db028d67565966547825b /OpenSim/Region | |
parent | * Add two more missing defaults that use GetBoolean without a default in stan... (diff) | |
download | opensim-SC_OLD-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.zip opensim-SC_OLD-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.tar.gz opensim-SC_OLD-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.tar.bz2 opensim-SC_OLD-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.tar.xz |
This reduces DNS lookups in TPs by a factor of 4. Let's see if this fixes some of the crashes experienced by ppl in Europe connected to OSGrid. If DNS lookup does not resolve, they may experience a substantial increase in "Region not available", but they shouldn't crash.
Diffstat (limited to 'OpenSim/Region')
3 files changed, 36 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index d4f66c7..0ee0869 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using System.Threading; | 33 | using System.Threading; |
33 | 34 | ||
@@ -148,6 +149,16 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
148 | destRegionUp = true; | 149 | destRegionUp = true; |
149 | } | 150 | } |
150 | 151 | ||
152 | // Let's do DNS resolution only once in this process, please! | ||
153 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, | ||
154 | // it's actually doing a lot of work. | ||
155 | IPEndPoint endPoint = reg.ExternalEndPoint; | ||
156 | if (endPoint.Address == null) | ||
157 | { | ||
158 | // Couldn't resolve the name. Can't TP, because the viewer wants IP addresses. | ||
159 | destRegionUp = false; | ||
160 | } | ||
161 | |||
151 | if (destRegionUp) | 162 | if (destRegionUp) |
152 | { | 163 | { |
153 | 164 | ||
@@ -206,15 +217,15 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
206 | 217 | ||
207 | if (eq != null) | 218 | if (eq != null) |
208 | { | 219 | { |
209 | OSD Item = EventQueueHelper.EnableSimulator(realHandle, reg.ExternalEndPoint); | 220 | OSD Item = EventQueueHelper.EnableSimulator(realHandle, endPoint); |
210 | eq.Enqueue(Item, avatar.UUID); | 221 | eq.Enqueue(Item, avatar.UUID); |
211 | 222 | ||
212 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, reg.ExternalEndPoint.ToString(), capsPath); | 223 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, endPoint.ToString(), capsPath); |
213 | eq.Enqueue(Item, avatar.UUID); | 224 | eq.Enqueue(Item, avatar.UUID); |
214 | } | 225 | } |
215 | else | 226 | else |
216 | { | 227 | { |
217 | avatar.ControllingClient.InformClientOfNeighbour(realHandle, reg.ExternalEndPoint); | 228 | avatar.ControllingClient.InformClientOfNeighbour(realHandle, endPoint); |
218 | // TODO: make Event Queue disablable! | 229 | // TODO: make Event Queue disablable! |
219 | } | 230 | } |
220 | } | 231 | } |
@@ -252,13 +263,13 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
252 | /// | 263 | /// |
253 | if (eq != null) | 264 | if (eq != null) |
254 | { | 265 | { |
255 | OSD Item = EventQueueHelper.TeleportFinishEvent(realHandle, 13, reg.ExternalEndPoint, | 266 | OSD Item = EventQueueHelper.TeleportFinishEvent(realHandle, 13, endPoint, |
256 | 4, teleportFlags, capsPath, avatar.UUID); | 267 | 4, teleportFlags, capsPath, avatar.UUID); |
257 | eq.Enqueue(Item, avatar.UUID); | 268 | eq.Enqueue(Item, avatar.UUID); |
258 | } | 269 | } |
259 | else | 270 | else |
260 | { | 271 | { |
261 | avatar.ControllingClient.SendRegionTeleport(realHandle, 13, reg.ExternalEndPoint, 4, | 272 | avatar.ControllingClient.SendRegionTeleport(realHandle, 13, endPoint, 4, |
262 | teleportFlags, capsPath); | 273 | teleportFlags, capsPath); |
263 | } | 274 | } |
264 | /// | 275 | /// |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 1476f88..2b8ee74 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2673,7 +2673,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2673 | m_sceneGridService.OnRegionUp += OtherRegionUp; | 2673 | m_sceneGridService.OnRegionUp += OtherRegionUp; |
2674 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 2674 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
2675 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; | 2675 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; |
2676 | m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 2676 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
2677 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 2677 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
2678 | m_sceneGridService.KiPrimitive += SendKillObject; | 2678 | m_sceneGridService.KiPrimitive += SendKillObject; |
2679 | m_sceneGridService.OnGetLandData += GetLandData; | 2679 | m_sceneGridService.OnGetLandData += GetLandData; |
@@ -2686,7 +2686,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2686 | { | 2686 | { |
2687 | m_sceneGridService.KiPrimitive -= SendKillObject; | 2687 | m_sceneGridService.KiPrimitive -= SendKillObject; |
2688 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; | 2688 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; |
2689 | m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; | 2689 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; |
2690 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; | 2690 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; |
2691 | m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | 2691 | m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; |
2692 | m_sceneGridService.OnRegionUp -= OtherRegionUp; | 2692 | m_sceneGridService.OnRegionUp -= OtherRegionUp; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 1d50865..2bfb7d6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | public event PrimCrossing OnPrimCrossingIntoRegion; | 60 | public event PrimCrossing OnPrimCrossingIntoRegion; |
61 | public event RegionUp OnRegionUp; | 61 | public event RegionUp OnRegionUp; |
62 | public event ChildAgentUpdate OnChildAgentUpdate; | 62 | public event ChildAgentUpdate OnChildAgentUpdate; |
63 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 63 | //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
64 | public event LogOffUser OnLogOffUser; | 64 | public event LogOffUser OnLogOffUser; |
65 | public event GetLandData OnGetLandData; | 65 | public event GetLandData OnGetLandData; |
66 | 66 | ||
@@ -729,6 +729,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
729 | { | 729 | { |
730 | // region is remote. see if it is up | 730 | // region is remote. see if it is up |
731 | destRegionUp = m_commsProvider.InterRegion.CheckRegion(reg.RemotingAddress, reg.RemotingPort); | 731 | destRegionUp = m_commsProvider.InterRegion.CheckRegion(reg.RemotingAddress, reg.RemotingPort); |
732 | |||
732 | } | 733 | } |
733 | else | 734 | else |
734 | { | 735 | { |
@@ -736,6 +737,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
736 | destRegionUp = true; | 737 | destRegionUp = true; |
737 | } | 738 | } |
738 | 739 | ||
740 | // Let's do DNS resolution only once in this process, please! | ||
741 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, | ||
742 | // it's actually doing a lot of work. | ||
743 | IPEndPoint endPoint = reg.ExternalEndPoint; | ||
744 | if (endPoint.Address == null) | ||
745 | { | ||
746 | // Couldn't resolve the name. Can't TP, because the viewer wants IP addresses. | ||
747 | destRegionUp = false; | ||
748 | } | ||
749 | |||
739 | if (destRegionUp) | 750 | if (destRegionUp) |
740 | { | 751 | { |
741 | uint newRegionX = (uint)(reg.RegionHandle >> 40); | 752 | uint newRegionX = (uint)(reg.RegionHandle >> 40); |
@@ -761,6 +772,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
761 | // once we reach here... | 772 | // once we reach here... |
762 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); | 773 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); |
763 | 774 | ||
775 | |||
764 | // Let's close some agents | 776 | // Let's close some agents |
765 | avatar.CloseChildAgents(newRegionX, newRegionY); | 777 | avatar.CloseChildAgents(newRegionX, newRegionY); |
766 | 778 | ||
@@ -791,15 +803,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
791 | 803 | ||
792 | if (eq != null) | 804 | if (eq != null) |
793 | { | 805 | { |
794 | OSD Item = EventQueueHelper.EnableSimulator(reg.RegionHandle, reg.ExternalEndPoint); | 806 | OSD Item = EventQueueHelper.EnableSimulator(reg.RegionHandle, endPoint); |
795 | eq.Enqueue(Item, avatar.UUID); | 807 | eq.Enqueue(Item, avatar.UUID); |
796 | 808 | ||
797 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, reg.ExternalEndPoint.ToString(), capsPath); | 809 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, endPoint.ToString(), capsPath); |
798 | eq.Enqueue(Item, avatar.UUID); | 810 | eq.Enqueue(Item, avatar.UUID); |
799 | } | 811 | } |
800 | else | 812 | else |
801 | { | 813 | { |
802 | avatar.ControllingClient.InformClientOfNeighbour(reg.RegionHandle, reg.ExternalEndPoint); | 814 | avatar.ControllingClient.InformClientOfNeighbour(reg.RegionHandle, endPoint); |
803 | } | 815 | } |
804 | } | 816 | } |
805 | else | 817 | else |
@@ -829,13 +841,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
829 | 841 | ||
830 | if (eq != null) | 842 | if (eq != null) |
831 | { | 843 | { |
832 | OSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, reg.ExternalEndPoint, | 844 | OSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, endPoint, |
833 | 4, teleportFlags, capsPath, avatar.UUID); | 845 | 4, teleportFlags, capsPath, avatar.UUID); |
834 | eq.Enqueue(Item, avatar.UUID); | 846 | eq.Enqueue(Item, avatar.UUID); |
835 | } | 847 | } |
836 | else | 848 | else |
837 | { | 849 | { |
838 | avatar.ControllingClient.SendRegionTeleport(reg.RegionHandle, 13, reg.ExternalEndPoint, 4, | 850 | avatar.ControllingClient.SendRegionTeleport(reg.RegionHandle, 13, endPoint, 4, |
839 | teleportFlags, capsPath); | 851 | teleportFlags, capsPath); |
840 | } | 852 | } |
841 | 853 | ||