diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a3c7750..f52a84c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -991,7 +991,7 @@ namespace OpenSim.Framework | |||
991 | return output.ToString(); | 991 | return output.ToString(); |
992 | } | 992 | } |
993 | 993 | ||
994 | static ExpiringCache<string,IPAddress> dnscache = new ExpiringCache<string, IPAddress>(); | 994 | private static ExpiringCache<string,IPAddress> dnscache = new ExpiringCache<string, IPAddress>(); |
995 | 995 | ||
996 | /// <summary> | 996 | /// <summary> |
997 | /// Converts a URL to a IPAddress | 997 | /// Converts a URL to a IPAddress |
@@ -1015,7 +1015,10 @@ namespace OpenSim.Framework | |||
1015 | 1015 | ||
1016 | IPAddress ia = null; | 1016 | IPAddress ia = null; |
1017 | if(dnscache.TryGetValue(dnsAddress, out ia) && ia != null) | 1017 | if(dnscache.TryGetValue(dnsAddress, out ia) && ia != null) |
1018 | { | ||
1019 | dnscache.AddOrUpdate(dnsAddress, ia, 300); | ||
1018 | return ia; | 1020 | return ia; |
1021 | } | ||
1019 | 1022 | ||
1020 | ia = null; | 1023 | ia = null; |
1021 | // If it is already an IP, don't let GetHostEntry see it | 1024 | // If it is already an IP, don't let GetHostEntry see it |
@@ -1081,7 +1084,10 @@ namespace OpenSim.Framework | |||
1081 | 1084 | ||
1082 | IPAddress ia = null; | 1085 | IPAddress ia = null; |
1083 | if(dnscache.TryGetValue(hostname, out ia) && ia != null) | 1086 | if(dnscache.TryGetValue(hostname, out ia) && ia != null) |
1087 | { | ||
1088 | dnscache.AddOrUpdate(hostname, ia, 300); | ||
1084 | return getEndPoint(ia, port); | 1089 | return getEndPoint(ia, port); |
1090 | } | ||
1085 | 1091 | ||
1086 | ia = null; | 1092 | ia = null; |
1087 | 1093 | ||