diff options
Diffstat (limited to 'lib/custodian')
| -rw-r--r-- | lib/custodian/protocoltest/http.rb | 31 | 
1 files changed, 15 insertions, 16 deletions
| diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb index 9ff734c..0bf1a68 100644 --- a/lib/custodian/protocoltest/http.rb +++ b/lib/custodian/protocoltest/http.rb @@ -89,27 +89,26 @@ module Custodian          # look it up, as both IPv4 and IPv6.          #          begin -          timeout(30) do -            type = case protocol -                   when :ipv4 -                     Resolv::DNS::Resource::IN::A -                   when :ipv6 -                     Resolv::DNS::Resource::IN::AAAA -                   else -                     raise ArgumentError, "Sanity-checking DNS-failure of unknown type: #{protocol}" -                   end - -            begin -              Resolv::DNS.open do |dns| -                ips = dns.getresources(target, type) -              end -            rescue Timeout::Error => _e -              # NOP +          type = case protocol +                 when :ipv4 +                   Resolv::DNS::Resource::IN::A +                 when :ipv6 +                   Resolv::DNS::Resource::IN::AAAA +                 else +                   raise ArgumentError, "Sanity-checking DNS-failure of unknown type: #{protocol}" +                 end + +          timeout(30) do +            Resolv::DNS.open do |dns| +              ips = dns.getresources(target, type)              end            end +        rescue Timeout::Error => _e +          # NOP          end +          #          #  At this point we either have:          # | 
