selfsdk 0.0.165 → 0.0.166
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messaging.rb +16 -16
- 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: 8c85c6fa67915d806be363e234ac87b2bdffc6d331a48a273f48f737bb476fa6
|
4
|
+
data.tar.gz: fadf3e8a7df24cb74b71fc0e695f647b94510afb4092e58ca86f9aa6e0d2deaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfc07013f91c98b460991df709e4526fe86ee37d6f26818d87fe3c29c10c99ec69401d1c51a1f7ab80f1a7bad1248ce81cb7091fa469d584863d962e6c39effa
|
7
|
+
data.tar.gz: 7f3455f82fd7a2dec5579dd67d4a43a80ffc3fb24b35f90f7ab82bffd86d264e8760154decc7119ffc9c9fc6976669f2804f0f8222c7f52a6a0e4ebe55496cc5
|
data/lib/messaging.rb
CHANGED
@@ -286,6 +286,14 @@ module SelfSDK
|
|
286
286
|
@acks["authentication"][:waiting_cond].wait_while { @acks["authentication"][:waiting] }
|
287
287
|
@acks.delete("authentication")
|
288
288
|
end
|
289
|
+
# In case this does not succeed start the process again.
|
290
|
+
if @acks.include? 'authentication'
|
291
|
+
if @acks['authentication'][:waiting]
|
292
|
+
close
|
293
|
+
start_connection
|
294
|
+
end
|
295
|
+
@acks.delete("authentication")
|
296
|
+
end
|
289
297
|
end
|
290
298
|
|
291
299
|
# Cleans expired messages
|
@@ -404,22 +412,14 @@ module SelfSDK
|
|
404
412
|
|
405
413
|
# Authenticates current client on the websocket server.
|
406
414
|
def authenticate
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
)
|
416
|
-
end
|
417
|
-
|
418
|
-
return res unless res.nil?
|
419
|
-
|
420
|
-
SelfSDK.logger.info "authentication timed out, retrying ..."
|
421
|
-
close
|
422
|
-
start_connection
|
415
|
+
SelfSDK.logger.info "authenticating"
|
416
|
+
send_raw Msgproto::Auth.new(
|
417
|
+
type: Msgproto::MsgType::AUTH,
|
418
|
+
id: "authentication",
|
419
|
+
token: @jwt.auth_token,
|
420
|
+
device: @device_id,
|
421
|
+
offset: @offset,
|
422
|
+
)
|
423
423
|
end
|
424
424
|
|
425
425
|
def send_raw(msg)
|