Ver código fonte

If a DNS resolution fails on an outbound request, simply allow it

Melanie Thielker 7 anos atrás
pai
commit
6463ab7d79
1 arquivos alterados com 12 adições e 2 exclusões
  1. 12 2
      OpenSim/Framework/OutboundUrlFilter.cs

+ 12 - 2
OpenSim/Framework/OutboundUrlFilter.cs

@@ -212,7 +212,17 @@ namespace OpenSim.Framework
             // Check that we are permitted to make calls to this endpoint.
             bool foundIpv4Address = false;
 
-            IPAddress[] addresses = Dns.GetHostAddresses(url.Host);
+            IPAddress[] addresses = null;
+            
+            try
+            {
+                addresses = Dns.GetHostAddresses(url.Host);
+            }
+            catch
+            {
+                // If there is a DNS error, we can't stop the script!
+                return true;
+            }
 
             foreach (IPAddress addr in addresses)
             {
@@ -253,4 +263,4 @@ namespace OpenSim.Framework
             return allowed;
         }
     }
-}
+}