Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Simplex/Messaging/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,14 @@ disconnectTransport THandle {connection, params = THandleParams {sessionId}} rcv
where
loop = do
threadDelay' $ checkInterval expCfg * 1000000
ifM noSubscriptions checkExpired loop
checkExpired = do
old <- expireBeforeEpoch expCfg
ifM noSubscriptions (checkExpired expCfg) (checkExpired expCfg')
checkExpired cfg = do
old <- expireBeforeEpoch cfg
ts <- max <$> readTVarIO rcvActiveAt <*> readTVarIO sndActiveAt
if systemSeconds ts < old then closeConnection connection else loop
expCfg' =
let ExpirationConfig {ttl} = expCfg
in expCfg {ttl = 3 * ttl}

data VerificationResult = VRVerified (Maybe QueueRec) | VRFailed

Expand Down