cool.io 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/cool.io/dns_resolver.rb +9 -0
- data/lib/cool.io/version.rb +1 -1
- data/spec/dns_spec.rb +7 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a611bb7980df8a3760bc51f76cfea2575521db42b21dd7be2f620e8b0ca8918
|
4
|
+
data.tar.gz: e95febff82569dd11e2fab485659274b52b3d0ff4eefbe5bd81f5ec2a16b28ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b174135504ba2eea8bfc4112ae3cc16816cade3b556af5ddc008a3e4efebab461e501173d3ff555e4bf980bec29766433d2494aef888088eb46071de2b87e2
|
7
|
+
data.tar.gz: 071a0831d705a71aed948ebe636590ba6eb9cd405ddd8fe886f8361ea3fb1da40f07eff24f3aaf435a94c3a40b560b157b468f1a29be9de508ab0142e740cecb
|
data/CHANGES.md
CHANGED
data/lib/cool.io/dns_resolver.rb
CHANGED
@@ -49,6 +49,15 @@ module Coolio
|
|
49
49
|
entries.each { |e| hosts[e] ||= addr }
|
50
50
|
end
|
51
51
|
end
|
52
|
+
if hosts.empty?
|
53
|
+
# On Windows, there is a case that hosts file doesn't have entry by default
|
54
|
+
# and preferred IPv4/IPv6 behavior may be changed by registry key [1], so
|
55
|
+
# "localhost" should be resolved by getaddrinfo.
|
56
|
+
# (first[3] means preferred resolved IP address ::1 or 127.0.0.1)
|
57
|
+
# [1] https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows
|
58
|
+
require "socket"
|
59
|
+
hosts["localhost"] = ::Socket.getaddrinfo("localhost", nil).first[3]
|
60
|
+
end
|
52
61
|
|
53
62
|
hosts[host]
|
54
63
|
end
|
data/lib/cool.io/version.rb
CHANGED
data/spec/dns_spec.rb
CHANGED
@@ -19,6 +19,7 @@ end
|
|
19
19
|
describe "DNS" do
|
20
20
|
before :each do
|
21
21
|
@loop = Cool.io::Loop.new
|
22
|
+
@preferred_localhost_address = ::Socket.getaddrinfo("localhost", nil).first[3]
|
22
23
|
end
|
23
24
|
|
24
25
|
it "connects to valid domains" do
|
@@ -40,4 +41,10 @@ describe "DNS" do
|
|
40
41
|
@loop.run
|
41
42
|
end.to raise_error(WontResolve)
|
42
43
|
end
|
44
|
+
|
45
|
+
it "resolve localhost even though hosts is empty" do
|
46
|
+
Tempfile.open("empty") do |file|
|
47
|
+
expect( Coolio::DNSResolver.hosts("localhost", file.path)).to eq @preferred_localhost_address
|
48
|
+
end
|
49
|
+
end
|
43
50
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cool.io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
- Masahiro Nakagawa
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -157,7 +157,7 @@ homepage: http://coolio.github.com
|
|
157
157
|
licenses:
|
158
158
|
- MIT
|
159
159
|
metadata: {}
|
160
|
-
post_install_message:
|
160
|
+
post_install_message:
|
161
161
|
rdoc_options: []
|
162
162
|
require_paths:
|
163
163
|
- lib
|
@@ -172,8 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
175
|
+
rubygems_version: 3.1.4
|
176
|
+
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: A cool framework for doing high performance I/O in Ruby
|
179
179
|
test_files:
|