fluent-plugin-syslog-gobi-tls 2.1.5 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fluent-plugin-syslog-tls.gemspec +1 -1
- data/lib/syslog_tls/ssl_transport.rb +16 -42
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f830f23b5e82896b3102d02ceadaa39df253b7e8bf5d62f7b6722cad71e3ed0e
|
4
|
+
data.tar.gz: 1f54823c1dd108ad3dc4512dcbaa9f6261ba267219e79af9dcde0c434259bbc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a137d1c350c3b49ca66c0baeb71d08b277dcfc5d71bb0db1b7b298dba77546a25e5a05fc5ce079dbf0ab207af5b3a7571bc1027af8a5251e0c6527e7f545772e
|
7
|
+
data.tar.gz: 3261fc10825eee93d250e60ace893fcc778c52b693e24eb16c12a42b767bf28fb66c2f0b6fda93fc8b1a32b28d88d7471debf1b55a562ad855d19f6a30f6d02f
|
@@ -19,7 +19,7 @@ require 'syslog_tls/version'
|
|
19
19
|
|
20
20
|
Gem::Specification.new do |s|
|
21
21
|
s.name = 'fluent-plugin-syslog-gobi-tls'
|
22
|
-
s.version = '2.1.
|
22
|
+
s.version = '2.1.8'
|
23
23
|
s.summary = %q{Fluent Syslog TLS output plugin}
|
24
24
|
s.authors = ['thomas morgan']
|
25
25
|
s.email = ['tm@iprog.com']
|
@@ -22,8 +22,7 @@ module SyslogTls
|
|
22
22
|
CONNECT_TIMEOUT = 10
|
23
23
|
# READ_TIMEOUT = 5
|
24
24
|
WRITE_TIMEOUT = 5
|
25
|
-
|
26
|
-
INITIAL_BACKOFF_DELAY = 1
|
25
|
+
|
27
26
|
attr_accessor :socket
|
28
27
|
|
29
28
|
attr_reader :host, :port, :idle_timeout, :ca_cert, :client_cert, :client_key, :verify_cert_name, :ssl_version
|
@@ -43,49 +42,22 @@ module SyslogTls
|
|
43
42
|
connect
|
44
43
|
end
|
45
44
|
|
46
|
-
def
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
loop do
|
45
|
+
def connect
|
46
|
+
@socket = get_ssl_connection
|
47
|
+
begin
|
51
48
|
begin
|
52
|
-
@socket = get_ssl_connection
|
53
49
|
@socket.connect_nonblock
|
54
|
-
break
|
55
50
|
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
56
51
|
select_with_timeout(@socket, :connect_read) && retry
|
57
52
|
rescue IO::WaitWritable
|
58
53
|
select_with_timeout(@socket, :connect_write) && retry
|
59
|
-
rescue Errno::ETIMEDOUT
|
60
|
-
raise 'Socket timeout during connect' if retries >= MAX_BACKOFF_RETRIES
|
61
|
-
|
62
|
-
# Exponential backoff
|
63
|
-
retries += 1
|
64
|
-
sleep(backoff_delay)
|
65
|
-
backoff_delay *= 2
|
66
54
|
end
|
55
|
+
rescue Errno::ETIMEDOUT
|
56
|
+
raise 'Socket timeout during connect'
|
67
57
|
end
|
68
|
-
|
69
58
|
@last_write = Time.now if idle_timeout
|
70
59
|
end
|
71
60
|
|
72
|
-
def connect
|
73
|
-
connect_with_backoff
|
74
|
-
#@socket = get_ssl_connection
|
75
|
-
#begin
|
76
|
-
# begin
|
77
|
-
# @socket.connect_nonblock
|
78
|
-
#rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
79
|
-
# select_with_timeout(@socket, :connect_read) && retry
|
80
|
-
#rescue IO::WaitWritable
|
81
|
-
# select_with_timeout(@socket, :connect_write) && retry
|
82
|
-
#end
|
83
|
-
#rescue Errno::ETIMEDOUT
|
84
|
-
# raise 'Socket timeout during connect'
|
85
|
-
#end
|
86
|
-
#@last_write = Time.now if idle_timeout
|
87
|
-
end
|
88
|
-
|
89
61
|
def get_tcp_connection
|
90
62
|
tcp = nil
|
91
63
|
|
@@ -101,14 +73,16 @@ module SyslogTls
|
|
101
73
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEPORT, true)
|
102
74
|
tcp.connect_nonblock(sock_addr)
|
103
75
|
rescue Errno::EINPROGRESS
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
rescue
|
110
|
-
|
111
|
-
|
76
|
+
tcp.close rescue nil
|
77
|
+
raise
|
78
|
+
# select_with_timeout(tcp, :connect_write)
|
79
|
+
# begin
|
80
|
+
# tcp.connect_nonblock(sock_addr)
|
81
|
+
# rescue Errno::EISCONN
|
82
|
+
# # all good
|
83
|
+
# rescue SystemCallError
|
84
|
+
# tcp.close rescue nil
|
85
|
+
# raise
|
112
86
|
end
|
113
87
|
rescue SystemCallError
|
114
88
|
tcp.close rescue nil
|