apiotics 0.1.108 → 0.1.109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apiotics/server.rb +11 -11
- data/lib/apiotics/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6ef8e91565022893a800c46b3993e58e4634276
|
4
|
+
data.tar.gz: 558da476179e50b2146f3ecc8b693ac578196c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea49225b841f7281f5e2046c1adf4fdb51d2673185e12a0014b01f08d04fe67200ab98997298d7e4b85232cd32f43d789bcf0dc39db4190760312f9094ab3a6b
|
7
|
+
data.tar.gz: 188d6b12d2ef73bd4bc8bef4876c6fa23bfc86dbd6f3bf1c8780b5e73762651fa5c30da14f799f1d62b2333a977757fa740456bf6c7eb2b76355fc3ca13300a5
|
data/lib/apiotics/server.rb
CHANGED
@@ -60,7 +60,7 @@ module Apiotics
|
|
60
60
|
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
61
61
|
end
|
62
62
|
@server = OpenSSL::SSL::SSLSocket.new socket, context
|
63
|
-
server.sync_close = true
|
63
|
+
@server.sync_close = true
|
64
64
|
@server.connect
|
65
65
|
if Apiotics.configuration.verify_peer == true
|
66
66
|
ca_tempfile.close(true)
|
@@ -125,10 +125,10 @@ module Apiotics
|
|
125
125
|
def listen_local
|
126
126
|
if Apiotics.configuration.redis_comms_connection == false
|
127
127
|
begin
|
128
|
-
|
128
|
+
@local_server = TCPServer.open(@localport)
|
129
129
|
loop do
|
130
130
|
Thread.abort_on_exception = true
|
131
|
-
Thread.fork(
|
131
|
+
Thread.fork(@local_server.accept) do |client|
|
132
132
|
s = client.gets
|
133
133
|
if @error_msg != nil
|
134
134
|
string = '{"error":"' + error_msg + '"}'
|
@@ -139,7 +139,7 @@ module Apiotics
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
rescue => e
|
142
|
-
|
142
|
+
@local_server.close
|
143
143
|
sleep 1
|
144
144
|
raise e
|
145
145
|
end
|
@@ -205,16 +205,16 @@ module Apiotics
|
|
205
205
|
context.ca_file = ca_tempfile.path
|
206
206
|
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
207
207
|
end
|
208
|
-
|
209
|
-
|
210
|
-
|
208
|
+
@apiary_server = OpenSSL::SSL::SSLSocket.new socket, context
|
209
|
+
@apiary_server.sync_close = true
|
210
|
+
@apiary_server.connect
|
211
211
|
else
|
212
|
-
|
212
|
+
@apiary_server = TCPSocket.open(Apiotics.configuration.server, Apiotics.configuration.server_port)
|
213
213
|
end
|
214
|
-
|
215
|
-
msg =
|
214
|
+
@apiary_server.puts('{"action":"lookup"}')
|
215
|
+
msg = @apiary_server.gets
|
216
216
|
hash = JSON.parse(msg)
|
217
|
-
|
217
|
+
@apiary_server.close
|
218
218
|
if Apiotics.configuration.verify_peer == true
|
219
219
|
ca_tempfile.close(true)
|
220
220
|
end
|
data/lib/apiotics/version.rb
CHANGED