sparoid 1.0.19 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/sparoid/version.rb +1 -1
- data/lib/sparoid.rb +15 -7
- 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: aa670db15a1fcc9faa4784c1bf568dc93d07b6bbeacabc7ce64ab0c167672f23
|
4
|
+
data.tar.gz: 2c8694a91e39a2da4720b6ec48802b36a229f6a90d503065004783a6b5e10d97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 248f53b8b4a2ad8f0dff46ad6ee3db3b3cce94f94c3c68ed8a38c1d2a5b97b3b2bcf912cb95da874b0079e7b8288a122d5726b7de5dacbe770fc4f4a20fc5f83
|
7
|
+
data.tar.gz: c9300feaee2514fd6403b00fdc61e1a5092e02c0973f89959205c423f5f4cb0362c7aa3f091820169634950749f9ddd1f86f9ad84a0a3270c224680a5e6bcee8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## [1.0.21] - 2022-10-12
|
2
|
+
|
3
|
+
- Fix where Sparoid::Instance returned nil for public_ip
|
4
|
+
|
5
|
+
## [1.0.20] - 2022-10-11
|
6
|
+
|
7
|
+
- Ignore EISCONN errors (already connected) error as BSD raises on second connect_nonblock
|
8
|
+
- Don't read from public ip disk cache in Sparoid::Instance
|
9
|
+
|
10
|
+
## [1.0.19] - 2022-10-11
|
11
|
+
|
12
|
+
- Fix nil error on timeout
|
13
|
+
|
1
14
|
## [1.0.18] - 2022-10-10
|
2
15
|
|
3
16
|
- Only resolv the IP(s) once
|
data/lib/sparoid/version.rb
CHANGED
data/lib/sparoid.rb
CHANGED
@@ -47,19 +47,22 @@ module Sparoid # rubocop:disable Metrics/ModuleLength
|
|
47
47
|
end
|
48
48
|
# wait for any socket to be connected
|
49
49
|
until sockets.empty?
|
50
|
-
_, writeable, = IO.select(nil, sockets, nil, connect_timeout)
|
51
|
-
|
52
|
-
|
50
|
+
_, writeable, errors = IO.select(nil, sockets, nil, connect_timeout) || break
|
51
|
+
errors.each { |s| sockets.delete(s) }
|
53
52
|
writeable.each do |s|
|
54
53
|
idx = sockets.index(s)
|
55
54
|
sockets.delete_at(idx) # don't retry this socket again
|
56
55
|
ip = ips.delete_at(idx) # find the IP for the socket
|
57
|
-
|
56
|
+
begin
|
57
|
+
s.connect_nonblock(Socket.sockaddr_in(port, ip)) # check for errors
|
58
|
+
rescue Errno::EISCONN
|
59
|
+
# already connected, continue
|
60
|
+
rescue SystemCallError
|
61
|
+
next # skip connection errors, hopefully at least one succeeds
|
62
|
+
end
|
58
63
|
# pass the connected FD to the parent process over STDOUT
|
59
64
|
Socket.for_fd(1).sendmsg "\0", 0, nil, Socket::AncillaryData.unix_rights(s)
|
60
65
|
exit 0 # exit as fast as possible so that other sockets don't connect
|
61
|
-
rescue SystemCallError
|
62
|
-
next # ignore connection errors, hopefully at least one succeeds
|
63
66
|
end
|
64
67
|
end
|
65
68
|
exit 1 # all connections failed
|
@@ -68,7 +71,8 @@ module Sparoid # rubocop:disable Metrics/ModuleLength
|
|
68
71
|
private
|
69
72
|
|
70
73
|
def sendmsg(addrs, data)
|
71
|
-
socket =
|
74
|
+
socket = UDPSocket.new
|
75
|
+
socket.nonblock = false
|
72
76
|
addrs.each do |addr|
|
73
77
|
socket.sendmsg data, 0, addr
|
74
78
|
rescue StandardError => e
|
@@ -165,5 +169,9 @@ module Sparoid # rubocop:disable Metrics/ModuleLength
|
|
165
169
|
def public_ip
|
166
170
|
@public_ip ||= super
|
167
171
|
end
|
172
|
+
|
173
|
+
def cached_public_ip
|
174
|
+
public_ip
|
175
|
+
end
|
168
176
|
end
|
169
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sparoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Hörberg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description:
|
27
|
+
description:
|
28
28
|
email:
|
29
29
|
- carl@84codes.com
|
30
30
|
executables:
|
@@ -55,7 +55,7 @@ metadata:
|
|
55
55
|
source_code_uri: https://github.com/84codes/sparoid.rb
|
56
56
|
changelog_uri: https://raw.githubusercontent.com/84codes/sparoid.rb/main/CHANGELOG.md
|
57
57
|
rubygems_mfa_required: 'true'
|
58
|
-
post_install_message:
|
58
|
+
post_install_message:
|
59
59
|
rdoc_options: []
|
60
60
|
require_paths:
|
61
61
|
- lib
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubygems_version: 3.3.7
|
74
|
-
signing_key:
|
74
|
+
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Single Packet Authorisation client
|
77
77
|
test_files: []
|