Send CRRemote*Stopped on all errors (#3376)

* Send CRRemote*Stopped on all errors

Commands use the same action, made idempotent and don't send events.

* fix tests

* get http2 cancelling back
This commit is contained in:
Alexander Bondarenko
2023-11-15 19:31:36 +02:00
committed by GitHub
parent a75fce8dfa
commit 339c3d2be1
5 changed files with 45 additions and 47 deletions
+1 -1
View File
@@ -375,7 +375,7 @@ restoreCalls = do
stopChatController :: forall m. MonadUnliftIO m => ChatController -> m ()
stopChatController ChatController {smpAgent, agentAsync = s, sndFiles, rcvFiles, expireCIFlags, remoteHostSessions, remoteCtrlSession} = do
readTVarIO remoteHostSessions >>= mapM_ (liftIO . cancelRemoteHost)
readTVarIO remoteHostSessions >>= mapM_ (liftIO . cancelRemoteHost True)
atomically (stateTVar remoteCtrlSession (,Nothing)) >>= mapM_ (liftIO . cancelRemoteCtrl)
disconnectAgentClient smpAgent
readTVarIO s >>= mapM_ (\(a1, a2) -> uninterruptibleCancel a1 >> mapM_ uninterruptibleCancel a2)