sping 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/last_acks.rb +3 -2
- data/lib/session_manager.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ee9e733c3d7c301a577743fa8ad173ff73892e2eda7988cae78e5284be643ca
|
4
|
+
data.tar.gz: b41a482c177c4ff3f49b5841377e9d9527bc5d5b5c71386eeb03b11721d3a122
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98be2095d2aa944081ab527bf4202ffd7c585c4f350a50d39ee65cf0e02a99cd5608631a0bf319a0337612e726d7d4c29633fb793f9816a0b4cecfe2f09af605
|
7
|
+
data.tar.gz: 95ceceaaf34a98eb4e793aeafe3d3dda89093863fccd45d89661e5f5d31b694658b7c8762269b2b42f9af2f3f4b1cb0e15e9e7b5c622b23c15512ce8c5b2bd51
|
data/lib/last_acks.rb
CHANGED
@@ -14,11 +14,12 @@ module SPing
|
|
14
14
|
@acks_mutex = Mutex.new
|
15
15
|
|
16
16
|
# Initiallize the circular buffer with 32 empty acks.
|
17
|
+
zero_time = Time.at(0)
|
17
18
|
32.times do |index|
|
18
19
|
@acks[index] = {
|
19
20
|
'R' => 0,
|
20
|
-
'U' =>
|
21
|
-
'X' =>
|
21
|
+
'U' => zero_time,
|
22
|
+
'X' => zero_time
|
22
23
|
}
|
23
24
|
end
|
24
25
|
end
|
data/lib/session_manager.rb
CHANGED
@@ -178,14 +178,15 @@ module SPing
|
|
178
178
|
# session IDs that have already been deleted.
|
179
179
|
# However, we can ignore this aspect here, as we are the only
|
180
180
|
# function that deletes sessions.
|
181
|
+
current_time = Time.now.to_i
|
181
182
|
if !(session.tcp_handshake_complete && session.udp_handshake_complete)
|
182
183
|
# Handshake incomplete
|
183
|
-
if (
|
184
|
+
if (current_time - session.created.to_i) > 60
|
184
185
|
# TCP and/or UDP take more than 60 seconds.
|
185
186
|
$logger.debug "UDP handshake for session id #{session_id} timed out."
|
186
187
|
del_session session_id
|
187
188
|
end
|
188
|
-
elsif (
|
189
|
+
elsif (current_time - session.last_rx.to_i) > 30
|
189
190
|
# 30 seconds have elapsed since the last ping from the peer was received.
|
190
191
|
# The peer is probably dead.
|
191
192
|
$logger.debug "Session id #{session_id} without activity for over thirty seconds."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Küthe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|