async-dns 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/dns/extensions/resolv.rb +1 -2
- data/lib/async/dns/handler.rb +1 -2
- data/lib/async/dns/version.rb +1 -1
- data/spec/async/dns/resolver_performance_spec.rb +74 -76
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90ce09288cd9b84da0b1031b85f76c9d7d2c1fc14344b209bcb0614f35e45fb5
|
4
|
+
data.tar.gz: c14524d10c279cfc673eab95fb024b9e41280c833dbfbf1c57650e8f7b3e31db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e72f090a02b1f5aee4d8834460678770ffd31ff89f69a6df1236ac3893899d488ce4d91b37972e050bba3a1e38b2267253249c92e2631f7620c5ef231d67f3cd
|
7
|
+
data.tar.gz: 3d93b690bc5f9438a0464f0d0e36227f24d1ed03ebf82a436919823f9531a6f3fc09dd470504605c5ea1d13230a65c4a720871d184a8a6ce1880e82a4bec66ef
|
@@ -26,7 +26,7 @@ class Resolv
|
|
26
26
|
# Merge the given message with this message. A number of heuristics are applied in order to ensure that the result makes sense. For example, If the current message is not recursive but is being merged with a message that was recursive, this bit is maintained. If either message is authoritive, then the result is also authoritive.
|
27
27
|
#
|
28
28
|
# Modifies the current message in place.
|
29
|
-
def merge!
|
29
|
+
def merge!(other)
|
30
30
|
# Authoritive Answer
|
31
31
|
@aa = @aa && other.aa
|
32
32
|
|
@@ -67,7 +67,6 @@ class Resolv
|
|
67
67
|
return self.class.new(@labels + origin, absolute)
|
68
68
|
end
|
69
69
|
|
70
|
-
|
71
70
|
# Return the name, typically relative, without the specified origin suffix. If the origin is nil, don't change the name, but change it to absolute (as specified).
|
72
71
|
def without_origin(origin, absolute = false)
|
73
72
|
return self.class.new(@labels, absolute) if origin == nil
|
data/lib/async/dns/handler.rb
CHANGED
@@ -59,8 +59,7 @@ module Async::DNS
|
|
59
59
|
|
60
60
|
return @server.process_query(query, options)
|
61
61
|
rescue StandardError => error
|
62
|
-
@logger.error
|
63
|
-
Async::DNS::log_exception(@logger, error)
|
62
|
+
@logger.error(error)
|
64
63
|
|
65
64
|
return error_response(query)
|
66
65
|
end
|
data/lib/async/dns/version.rb
CHANGED
@@ -22,86 +22,84 @@
|
|
22
22
|
|
23
23
|
require 'async/dns'
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
25
|
+
RSpec.describe Async::DNS::Resolver , timeout: 30 do
|
26
|
+
context 'benchmark' do
|
27
|
+
domains = %W{
|
28
|
+
Facebook.com
|
29
|
+
Twitter.com
|
30
|
+
Google.com
|
31
|
+
Youtube.com
|
32
|
+
Wordpress.org
|
33
|
+
Adobe.com
|
34
|
+
Blogspot.com
|
35
|
+
Wikipedia.org
|
36
|
+
Linkedin.com
|
37
|
+
Wordpress.com
|
38
|
+
Yahoo.com
|
39
|
+
Amazon.com
|
40
|
+
Flickr.com
|
41
|
+
Pinterest.com
|
42
|
+
Tumblr.com
|
43
|
+
W3.org
|
44
|
+
Apple.com
|
45
|
+
Myspace.com
|
46
|
+
Vimeo.com
|
47
|
+
Microsoft.com
|
48
|
+
Youtu.be
|
49
|
+
Qq.com
|
50
|
+
Digg.com
|
51
|
+
Baidu.com
|
52
|
+
Stumbleupon.com
|
53
|
+
Addthis.com
|
54
|
+
Statcounter.com
|
55
|
+
Feedburner.com
|
56
|
+
TradeMe.co.nz
|
57
|
+
Nytimes.com
|
58
|
+
Reddit.com
|
59
|
+
Weebly.com
|
60
|
+
Bbc.co.uk
|
61
|
+
Blogger.com
|
62
|
+
Msn.com
|
63
|
+
Macromedia.com
|
64
|
+
Goo.gl
|
65
|
+
Instagram.com
|
66
|
+
Gov.uk
|
67
|
+
Icio.us
|
68
|
+
Yandex.ru
|
69
|
+
Cnn.com
|
70
|
+
Webs.com
|
71
|
+
Google.de
|
72
|
+
T.co
|
73
|
+
Livejournal.com
|
74
|
+
Imdb.com
|
75
|
+
Mail.ru
|
76
|
+
Jimdo.com
|
77
|
+
}
|
78
|
+
|
79
|
+
before do
|
80
|
+
require 'benchmark'
|
81
|
+
end
|
79
82
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
it 'should be faster than native resolver' do
|
87
|
-
Benchmark.bm(30) do |x|
|
88
|
-
a = x.report("Async::DNS::Resolver") do
|
89
|
-
resolver = Async::DNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
90
|
-
|
91
|
-
resolved = domains.collect{|domain| resolver.addresses_for(domain)}
|
92
|
-
end
|
93
|
-
|
94
|
-
b = x.report("Resolv::DNS") do
|
95
|
-
resolver = Resolv::DNS.new(:nameserver => "8.8.8.8")
|
83
|
+
include_context Async::RSpec::Reactor
|
84
|
+
|
85
|
+
it 'should be faster than native resolver' do
|
86
|
+
Benchmark.bm(30) do |x|
|
87
|
+
a = x.report("Async::DNS::Resolver") do
|
88
|
+
resolver = Async::DNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
96
89
|
|
97
|
-
|
98
|
-
|
99
|
-
|
90
|
+
resolved = domains.collect{|domain| resolver.addresses_for(domain)}
|
91
|
+
end
|
92
|
+
|
93
|
+
b = x.report("Resolv::DNS") do
|
94
|
+
resolver = Resolv::DNS.new(:nameserver => "8.8.8.8")
|
95
|
+
|
96
|
+
resolved = domains.collect do |domain|
|
97
|
+
[domain, resolver.getaddresses(domain)]
|
100
98
|
end
|
101
|
-
|
102
|
-
# This is a regression, but not important right now.
|
103
|
-
# expect(a.real).to be < b.real
|
104
99
|
end
|
100
|
+
|
101
|
+
# This is a regression, but not important right now.
|
102
|
+
# expect(a.real).to be < b.real
|
105
103
|
end
|
106
104
|
end
|
107
105
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
rubygems_version: 3.0.
|
167
|
+
rubygems_version: 3.0.3
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: An easy to use DNS client resolver and server for Ruby.
|