aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-11-23 10:49:11 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-11-23 10:49:11 +0000
commit73972fbcf2ce001c0b465f57bc748ab3a976412c (patch)
treeabd373ac65d7d4bb1ca6794e339a74c87182b12e /lib/mauve
parent7ee5acc25e47a0d1c8d27acb8ce4e80ad48087b6 (diff)
Minimal DNS now also extends to resolution of items in the source
lists too, as well as the hostname/IP being queried.
Diffstat (limited to 'lib/mauve')
-rw-r--r--lib/mauve/source_list.rb32
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/mauve/source_list.rb b/lib/mauve/source_list.rb
index 869d99a..d1eafc6 100644
--- a/lib/mauve/source_list.rb
+++ b/lib/mauve/source_list.rb
@@ -169,21 +169,29 @@ module Mauve
#
def resolve
@last_resolved_at = Time.now
-
- url_list = []
- if @url
- url_list_s = do_get(@url)
- if url_list_s.is_a?(String)
- url_list = url_list_s.split("\n").collect{|s| do_parse_source(s)}.flatten.compact
+
+ if true == Configuration.current.minimal_dns_lookups
+
+ new_list = [] + @list
+
+ else
+
+ url_list = []
+ if @url
+ url_list_s = do_get(@url)
+ if url_list_s.is_a?(String)
+ url_list = url_list_s.split("\n").collect{|s| do_parse_source(s)}.flatten.compact
+ end
end
- end
- new_list = (url_list + @list).collect do |host|
- if host.is_a?(String)
- [host] + MauveResolv.get_ips_for(host).collect{|i| IPAddr.new(i)}
- else
- host
+ new_list = (url_list + @list).collect do |host|
+ if host.is_a?(String)
+ [host] + MauveResolv.get_ips_for(host).collect{|i| IPAddr.new(i)}
+ else
+ host
+ end
end
+
end
@resolved_list = new_list.flatten