remote_syslog_sender 1.1.4 → 1.2.0
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/lib/remote_syslog_sender/tcp_sender.rb +7 -4
- data/remote_syslog_sender.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42092d994e9efb80b76a480394d234a4f6323598
|
4
|
+
data.tar.gz: c1eba5a22d33471f2eb8ba38b2af20b9a15513b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c592dc4e54a2d8dc827a5007e5fc7d49416c504b142c311051174498eeaf6c95d6461435721bfb4d9495ce2fc2cce3c7d54306d13ead8762aced09ef49c339c9
|
7
|
+
data.tar.gz: a212f43c5e3c6124b1cfd07cdc198977e1637e5f8d551ec828762bec825343a294ec529bc5b7c6dd27a776d7f74a70bcc53e4079026f6ed8b40a40cabfaacaaa
|
@@ -19,7 +19,9 @@ module RemoteSyslogSender
|
|
19
19
|
@timeout = options[:timeout] || 600
|
20
20
|
@timeout_exception = !!options[:timeout_exception]
|
21
21
|
@exponential_backoff = !!options[:exponential_backoff]
|
22
|
-
|
22
|
+
|
23
|
+
@mutex = Mutex.new
|
24
|
+
@tcp_socket = nil
|
23
25
|
|
24
26
|
if [:SOL_SOCKET, :SO_KEEPALIVE, :IPPROTO_TCP, :TCP_KEEPIDLE].all? {|c| Socket.const_defined? c}
|
25
27
|
@keep_alive = options[:keep_alive]
|
@@ -47,8 +49,10 @@ module RemoteSyslogSender
|
|
47
49
|
connect_retry_count = 0
|
48
50
|
connect_retry_limit = 3
|
49
51
|
connect_retry_interval = 1
|
50
|
-
@
|
52
|
+
@mutex.synchronize do
|
51
53
|
begin
|
54
|
+
close
|
55
|
+
|
52
56
|
@tcp_socket = TCPSocket.new(@remote_hostname, @remote_port)
|
53
57
|
|
54
58
|
if @keep_alive
|
@@ -71,7 +75,6 @@ module RemoteSyslogSender
|
|
71
75
|
@socket = @tcp_socket
|
72
76
|
end
|
73
77
|
rescue
|
74
|
-
close
|
75
78
|
if connect_retry_count < connect_retry_limit
|
76
79
|
sleep connect_retry_interval
|
77
80
|
connect_retry_count += 1
|
@@ -101,7 +104,7 @@ module RemoteSyslogSender
|
|
101
104
|
until payload_size <= 0
|
102
105
|
start = get_time
|
103
106
|
begin
|
104
|
-
result = @socket.__send__(method, payload)
|
107
|
+
result = @mutex.synchronize { @socket.__send__(method, payload) }
|
105
108
|
payload_size -= result
|
106
109
|
payload.slice!(0, result) if payload_size > 0
|
107
110
|
rescue IO::WaitReadable
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'remote_syslog_sender'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.2.0'
|
4
4
|
s.summary = "Message sender that sends directly to a remote syslog endpoint"
|
5
5
|
s.description = "Message sender that sends directly to a remote syslog endpoint (Support UDP, TCP, TCP+TLS)"
|
6
6
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_syslog_sender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomohiro Hashidate
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: syslog_protocol
|