tcp-client 0.5.0 → 0.5.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: b3222937127a374a29b4f69d84a1e45d78ccc74bffee2ed05d849782385c5402
4
- data.tar.gz: 8a56cb5574794f4bbf0f5fcb1f91fbbdc033120eefc86604f881322ddfeedf44
3
+ metadata.gz: f36e18e6865766292ff44adf5cd46244e8944049f524553ba4168725454a2d0b
4
+ data.tar.gz: abd4ec63f48c1be4e73922aaed7702bdacebe398e6cda13887fcd2efaa62818c
5
5
  SHA512:
6
- metadata.gz: a096f6f5d41be9f63e5018f014aced375ab5e4574a7ea165bd006be23a9246264fcf77269f6be4335ee6f930794b1ef3332e08ccd580d54601eef2468bdf282d
7
- data.tar.gz: ee8edc735c7de68b28688043c8bf6d2715f177941c4e14f4bb742a91c1fc8edf4d47d3c5273379d4f0ec029418506dc3e52f3bbacfbff6cc4466fe7d22bf40f5
6
+ metadata.gz: 11b5302d3da2d0d46f35fb2370177916b1044b659b1f62bdbf0a30c39581844dd425487a6c94300b4a7afcf25eafef5828a6ef04cb0ff9bcae4fff01a9a312bb
7
+ data.tar.gz: 54b3505c1eb90565e0a80dab5c92a394883b74cf3bb975ed83df4c1affbad15e9acbfcee7ec3d0a5bb79c1486fa46fbfbd958fc9e43106b9a97dc22411c84335
@@ -37,7 +37,7 @@ class TCPClient
37
37
 
38
38
  def initialize_copy(_org)
39
39
  super
40
- @ssl_params = @ssl_params.dup
40
+ @ssl_params = Hash[@ssl_params] if @ssl_params
41
41
  self
42
42
  end
43
43
 
@@ -48,7 +48,7 @@ class TCPClient
48
48
  def ssl=(value)
49
49
  @ssl_params =
50
50
  if Hash === value
51
- value.dup
51
+ Hash[value]
52
52
  else
53
53
  value ? {} : nil
54
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TCPClient
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
data/lib/tcp-client.rb CHANGED
@@ -91,19 +91,9 @@ class TCPClient
91
91
  def create_socket(exception)
92
92
  exception ||= @configuration.connect_timeout_error
93
93
  deadline = Deadline.new(@configuration.connect_timeout)
94
- socket = TCPSocket.new(@address, @configuration, deadline, exception)
95
- @configuration.ssl? ? as_ssl_socket(socket, deadline, exception) : socket
96
- end
97
-
98
- def as_ssl_socket(socket, deadline, exception)
99
- SSLSocket.new(socket, @address, @configuration, deadline, exception)
100
- rescue StandardError => e
101
- begin
102
- socket.close
103
- rescue IOError
104
- # ignore!
105
- end
106
- raise(e, cause: e.cause)
94
+ @socket = TCPSocket.new(@address, @configuration, deadline, exception)
95
+ return @socket unless @configuration.ssl?
96
+ SSLSocket.new(@socket, @address, @configuration, deadline, exception)
107
97
  end
108
98
 
109
99
  def read_with_deadline(nbytes, deadline, exception)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcp-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Blumtritt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-07 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.2.15
117
+ rubygems_version: 3.2.22
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: A TCP client implementation with working timeout support.