io_request 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/io_request.rb +3 -0
- data/lib/io_request/client.rb +1 -4
- data/lib/io_request/connection/ssl_sockets.rb +9 -3
- data/lib/io_request/version.rb +1 -1
- 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: e57d41dbda1d6665dd595e36da99ce52b60fd2d979957583570224e752b6e8ae
|
4
|
+
data.tar.gz: eb50b39358a127a3b6b231d37606a4835b92030b682987bdd6f5a973d3c5b8bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9680f420318ec5d177ada3d79cccd5bab722e1993f541e802d877603bfa9011fb22cd0df5b9f01602a7a4ba54131203d1f2a7645950cdc4ef0adc151fb85c15
|
7
|
+
data.tar.gz: 92ea531ada90eda834b847d86009c4ede9594185540acbe7f76a65d0f579b62ff739b9a5ef01acc3d3b08657b97a7ab3a8e36c0dacc90024bd60c53c53b85866
|
data/lib/io_request.rb
CHANGED
data/lib/io_request/client.rb
CHANGED
@@ -130,10 +130,7 @@ module IORequest
|
|
130
130
|
@authorizer.authorize(@io_r, @io_w)
|
131
131
|
end
|
132
132
|
end
|
133
|
-
unless auth_successful
|
134
|
-
IORequest.logger.debug(prog_name) { 'Authorization failed' }
|
135
|
-
raise 'Authorization failed'
|
136
|
-
end
|
133
|
+
raise AuthorizationFailureError unless auth_successful
|
137
134
|
|
138
135
|
IORequest.logger.debug(prog_name) { "New client authorized with data #{@authorizer.data}" }
|
139
136
|
end
|
@@ -84,12 +84,12 @@ module IORequest
|
|
84
84
|
client.on_close do
|
85
85
|
@clients.select!(&:open?)
|
86
86
|
end
|
87
|
-
rescue StandardError
|
88
|
-
IORequest.debug "Failed to open client: #{e}"
|
87
|
+
rescue StandardError => e
|
88
|
+
IORequest.logger.debug "Failed to open client: #{e}"
|
89
89
|
ssl_socket.close
|
90
90
|
end
|
91
91
|
rescue StandardError => e
|
92
|
-
IORequest.warn "Unknown error while handling sockets: #{e}"
|
92
|
+
IORequest.logger.warn "Unknown error while handling sockets: #{e}"
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -108,9 +108,15 @@ module IORequest
|
|
108
108
|
@authorizer = authorizer
|
109
109
|
@requests_handler = requests_handler
|
110
110
|
|
111
|
+
@client = nil
|
112
|
+
|
111
113
|
initialize_ssl_context(certificate, key)
|
112
114
|
end
|
113
115
|
|
116
|
+
def connected?
|
117
|
+
!@client.nil?
|
118
|
+
end
|
119
|
+
|
114
120
|
# Connect to server.
|
115
121
|
# @param host [String] host of server.
|
116
122
|
# @param port [Integer] port of server.
|
data/lib/io_request/version.rb
CHANGED