aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
authordiva2008-12-20 18:15:02 +0000
committerdiva2008-12-20 18:15:02 +0000
commitfcf61c4d0db38e39e1db9e54602290ab0f1f1204 (patch)
treeb78984fd248e59bc084db028d67565966547825b /OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
parent* Add two more missing defaults that use GetBoolean without a default in stan... (diff)
downloadopensim-SC-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.zip
opensim-SC-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.tar.gz
opensim-SC-fcf61c4d0db38e39e1db9e54602290ab0f1f1204.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs24
1 files changed, 18 insertions, 6 deletions
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