riemann-client 1.1.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33657c1dcec6dce903bd90154f17f3a31174b6e0fa146609941dc36960c2b6e2
4
- data.tar.gz: 372a73585a2046e5af3a16ddd84254af64e6f6d17c6911183cf6c408eb22ac07
3
+ metadata.gz: 4d1995b06fc640ef8e66c806a1d89d59dfa58238c11049310255bf542121a4ea
4
+ data.tar.gz: dccb036f711cc73847cd81104756cd2d8b52fd9a5aa67c0528bd721a040ab504
5
5
  SHA512:
6
- metadata.gz: 694404b98fe75bb304f8d8da0903eb128d2600ecd83bc3b6c3d4e2b41eef2695a82e6df00c0f9c3a59115837e58314e6cdb88d56c1b10c959bd912d69ace479c
7
- data.tar.gz: 874fdd45638f808e1bf9641616fe5342c01c3a51245f9d66542a9aec60751a093462e70c123e027a463dcedfcb608dfc98087ae4ad189fd02aa97210b8e90fdd
6
+ metadata.gz: 3079702426c293a96a1e07b38ccffb281a53ab31ca653bfb5dcf2952a0a53c5e714b55e92d42ba28bb0cfff0b97bf472a2eb319dc90a12350f72273e4954bd09
7
+ data.tar.gz: 46c21db177b2d22c61bd82bfd94b62321b54c893a596f37daf9f8e1e9297a02689784d3637a8be54cd0d9b4dd4f9f7e21a10c91d1e5232fe001b84d984173c8f
@@ -5,7 +5,14 @@
5
5
 
6
6
  version: 2
7
7
  updates:
8
+ # Open PR for gem updates
8
9
  - package-ecosystem: "bundler" # See documentation for possible values
9
10
  directory: "/" # Location of package manifests
10
11
  schedule:
11
12
  interval: "daily"
13
+
14
+ # Open PR for GitHub Actions updates
15
+ - package-ecosystem: "github-actions"
16
+ directory: "/"
17
+ schedule:
18
+ interval: "daily"
data/.rubocop.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  ---
2
+ AllCops:
3
+ TargetRubyVersion: 2.6
2
4
  require:
3
5
  - rubocop-rspec
4
6
  Metrics/AbcSize:
@@ -13,8 +15,5 @@ Metrics/MethodLength:
13
15
  Enabled: false
14
16
  Metrics/PerceivedComplexity:
15
17
  Enabled: false
16
- Naming/VariableNumber:
17
- AllowedIdentifiers:
18
- - TLSv1_2
19
18
  Style/Documentation:
20
19
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.2.1](https://github.com/riemann/riemann-ruby-client/tree/v1.2.1) (2023-07-30)
4
+
5
+ [Full Changelog](https://github.com/riemann/riemann-ruby-client/compare/v1.2.0...v1.2.1)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Fix sending large batch of events over TLS [\#51](https://github.com/riemann/riemann-ruby-client/pull/51) ([smortex](https://github.com/smortex))
10
+
11
+ ## [v1.2.0](https://github.com/riemann/riemann-ruby-client/tree/v1.2.0) (2023-06-28)
12
+
13
+ [Full Changelog](https://github.com/riemann/riemann-ruby-client/compare/v1.1.0...v1.2.0)
14
+
15
+ **Implemented enhancements:**
16
+
17
+ - Allow connection to Riemann using TLS 1.3 [\#49](https://github.com/riemann/riemann-ruby-client/pull/49) ([smortex](https://github.com/smortex))
18
+
3
19
  ## [v1.1.0](https://github.com/riemann/riemann-ruby-client/tree/v1.1.0) (2023-01-23)
4
20
 
5
21
  [Full Changelog](https://github.com/riemann/riemann-ruby-client/compare/v1.0.1...v1.1.0)
@@ -20,7 +20,7 @@ module Riemann
20
20
  ctx.key = OpenSSL::PKey::RSA.new(File.read(@key_file))
21
21
  ctx.cert = OpenSSL::X509::Certificate.new(File.read(@cert_file))
22
22
  ctx.ca_file = @ca_file if @ca_file
23
- ctx.ssl_version = :TLSv1_2
23
+ ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION
24
24
  ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER if @ssl_verify
25
25
  end
26
26
  end
@@ -53,40 +53,6 @@ module Riemann
53
53
  end
54
54
  ssl_socket
55
55
  end
56
-
57
- # Internal: Read up to a maxlen of data from the socket and store it in outbuf
58
- #
59
- # maxlen - the maximum number of bytes to read from the socket
60
- # outbuf - the buffer in which to store the bytes.
61
- #
62
- # Returns the bytes read
63
- def readpartial(maxlen, outbuf = nil)
64
- super(maxlen, outbuf)
65
- rescue OpenSSL::SSL::SSLErrorWaitReadable
66
- unless wait_readable(read_timeout)
67
- raise Timeout, "Could not read from #{host}:#{port} in #{read_timeout} seconds"
68
- end
69
-
70
- retry
71
- end
72
-
73
- # Internal: Write the given data to the socket
74
- #
75
- # buf - the data to write to the socket.
76
- #
77
- # Raises an error if it is unable to write the data to the socket within the
78
- # write_timeout.
79
- #
80
- # returns nothing
81
- def write(buf)
82
- super(buf)
83
- rescue OpenSSL::SSL::SSLErrorWaitWritable
84
- unless wait_writable(write_timeout)
85
- raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
86
- end
87
-
88
- retry
89
- end
90
56
  end
91
57
  end
92
58
  end
@@ -17,7 +17,7 @@ module Riemann
17
17
 
18
18
  # Public: Return a socket factory
19
19
  def self.socket_factory
20
- @socket_factory || proc { |options|
20
+ @socket_factory ||= proc { |options|
21
21
  if options[:ssl]
22
22
  SSLSocket.connect(options)
23
23
  else
@@ -29,6 +29,8 @@ module Riemann
29
29
  def initialize(options = {}) # rubocop:disable Lint/MissingSuper
30
30
  @options = options
31
31
  @locket = Monitor.new
32
+ @socket = nil
33
+ @pid = nil
32
34
  end
33
35
 
34
36
  def socket
@@ -311,7 +311,7 @@ module Riemann
311
311
  # Returns the bytes read
312
312
  def readpartial(maxlen, outbuf = nil)
313
313
  socket.read_nonblock(maxlen, outbuf)
314
- rescue Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNRESET
314
+ rescue Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::ECONNRESET, IO::WaitReadable
315
315
  unless wait_readable(read_timeout)
316
316
  raise Timeout, "Could not read from #{host}:#{port} in #{read_timeout} seconds"
317
317
  end
@@ -332,11 +332,19 @@ module Riemann
332
332
  written = socket.write_nonblock(buf)
333
333
  buf = buf[written, buf.length]
334
334
  end
335
- rescue Errno::EWOULDBLOCK, Errno::EINTR, Errno::EAGAIN, Errno::ECONNRESET
335
+ rescue Errno::EWOULDBLOCK, Errno::EINTR, Errno::EAGAIN, Errno::ECONNRESET, IO::WaitWritable
336
336
  unless wait_writable(write_timeout)
337
337
  raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
338
338
  end
339
339
 
340
+ retry
341
+ rescue IO::WaitReadable
342
+ # Also rescued for SSL renegotiation in OpenSSL::SSL::SSLSocket according to
343
+ # https://ruby-doc.org/core-2.7.1/IO.html#method-c-select
344
+ unless wait_readable(read_timeout)
345
+ raise Timeout, "Could not write to #{host}:#{port} in #{write_timeout} seconds"
346
+ end
347
+
340
348
  retry
341
349
  end
342
350
 
@@ -11,6 +11,7 @@ module Riemann
11
11
  @host = opts[:host] || HOST
12
12
  @port = opts[:port] || PORT
13
13
  @max_size = opts[:max_size] || MAX_SIZE
14
+ @socket = nil
14
15
  end
15
16
 
16
17
  def socket
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Riemann
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.3.26
167
+ rubygems_version: 3.4.15
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Client for the distributed event system Riemann.