fluent-plugin-syslog-gobi-tls 2.1.17 → 2.1.18
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 +17 -57
- 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: 287edad13098ed291c057cf494827592b646ae9b8ca58c3b80edb428f4500740
|
4
|
+
data.tar.gz: 84889f89cedcfc4b030015d63295992c75534bd6efaea86e9a571780e5e85be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32422e64ce1f4053f310bf57a4950831c8214dbd3b73c1cfd3199f93c2889da1dcbf3fcc688b9564509f95118ccf011f844ba973a07107979892a7df01b06d16
|
7
|
+
data.tar.gz: 00b1e2177e78009a05f682dbd668badc6c56cdbceee73346e7de3fe3c766838fa6d1804c5a02db5ed82b84d451c72342f327cb8da6158170513ff4218ae23533
|
@@ -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.18'
|
23
23
|
s.summary = %q{Fluent Syslog TLS output plugin}
|
24
24
|
s.authors = ['thomas morgan']
|
25
25
|
s.email = ['tm@iprog.com']
|
@@ -39,27 +39,17 @@ module SyslogTls
|
|
39
39
|
@verify_cert_name = verify_cert_name
|
40
40
|
@ssl_version = ssl_version
|
41
41
|
@retries = max_retries
|
42
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
43
|
-
puts "[#{timestamp}] in initialize: #{idle_timeout}"
|
44
42
|
connect
|
45
43
|
end
|
46
44
|
|
47
45
|
def connect
|
48
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
49
|
-
puts "[#{timestamp}] in connect"
|
50
46
|
@socket = get_ssl_connection
|
51
47
|
begin
|
52
48
|
begin
|
53
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
54
|
-
puts "[#{timestamp}] in connect doing connect_nonblock"
|
55
49
|
@socket.connect_nonblock
|
56
|
-
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
57
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
58
|
-
puts "[#{timestamp}] in connect EAGAIN rescue: #{e.class} exception #{e.message} "
|
50
|
+
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
59
51
|
select_with_timeout(@socket, :connect_read) && retry
|
60
|
-
rescue IO::WaitWritable
|
61
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
62
|
-
puts "[#{timestamp}] in connect WaitWritable rescue: #{e.class} exception #{e.message} "
|
52
|
+
rescue IO::WaitWritable
|
63
53
|
select_with_timeout(@socket, :connect_write) && retry
|
64
54
|
end
|
65
55
|
rescue Errno::ETIMEDOUT
|
@@ -69,8 +59,6 @@ module SyslogTls
|
|
69
59
|
end
|
70
60
|
|
71
61
|
def get_tcp_connection
|
72
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
73
|
-
puts "[#{timestamp}] in get_tcp_connection"
|
74
62
|
tcp = nil
|
75
63
|
|
76
64
|
family = Socket::Constants::AF_UNSPEC
|
@@ -84,34 +72,20 @@ module SyslogTls
|
|
84
72
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEADDR, true)
|
85
73
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEPORT, true)
|
86
74
|
tcp.connect_nonblock(sock_addr)
|
87
|
-
rescue Errno::EINPROGRESS
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
# all good
|
102
|
-
rescue SystemCallError => e
|
103
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
104
|
-
puts "[#{timestamp}] in get_tcp_connection SystemCallError exception during TCP connection:"
|
105
|
-
puts "[#{timestamp}] Message: #{e.message}"
|
106
|
-
puts "[#{timestamp}] Backtrace: #{e.backtrace.join("\n")}"
|
107
|
-
tcp.close rescue nil
|
108
|
-
raise
|
109
|
-
end
|
110
|
-
rescue SystemCallError => e
|
111
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
112
|
-
puts "[#{timestamp}] in get_tcp_connection SystemCallError outer exception during TCP connection:"
|
113
|
-
puts "[#{timestamp}] Message: #{e.message}"
|
114
|
-
puts "[#{timestamp}] Backtrace: #{e.backtrace.join("\n")}"
|
75
|
+
# rescue Errno::EINPROGRESS
|
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
|
86
|
+
rescue Exception => e
|
87
|
+
# Log the exception
|
88
|
+
puts "Exception during TCP connection: #{e.message}"
|
115
89
|
tcp.close rescue nil
|
116
90
|
raise
|
117
91
|
end
|
@@ -121,9 +95,6 @@ module SyslogTls
|
|
121
95
|
end
|
122
96
|
|
123
97
|
def get_ssl_connection
|
124
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
125
|
-
puts "[#{timestamp}] in get_ssl_connection"
|
126
|
-
|
127
98
|
tcp = get_tcp_connection
|
128
99
|
|
129
100
|
ctx = OpenSSL::SSL::SSLContext.new
|
@@ -210,18 +181,7 @@ module SyslogTls
|
|
210
181
|
else
|
211
182
|
raise "Unknown select type #{type}"
|
212
183
|
end
|
213
|
-
|
214
|
-
IO.select(*args) || raise("Socket timeout during #{type}")
|
215
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
216
|
-
# puts "[#{timestamp}] in select_with_timeout: IO.select result during #{type}: #{result.inspect}"
|
217
|
-
puts "[#{timestamp}] in select_with_timeout: IO.select result during"
|
218
|
-
# Code that may raise exceptions
|
219
|
-
rescue => e
|
220
|
-
# Catch all exceptions and log for testing/debugging
|
221
|
-
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
222
|
-
puts "[#{timestamp}] Caught exception: #{e.class} - #{e.message}"
|
223
|
-
puts e.backtrace.join("\n")
|
224
|
-
end
|
184
|
+
IO.select(*args) || raise("Socket timeout during #{type}")
|
225
185
|
end
|
226
186
|
|
227
187
|
# Forward any methods directly to SSLSocket
|