mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-11-04 08:37:49 +00:00
fix, debug
This commit is contained in:
1 parent
7e06d55ff5
commit
14dab311e9
2 files changed
+9
-2
No files matched your search
@@ -314,7 +314,8 @@ runXFTPRcvLocalWorker c Worker {doWork} = do
|
||||
case redirect of
|
||||
Nothing -> do
|
||||
notify c rcvFileEntityId $ RFDONE fsSavePath
|
||||
lift $ forM_ tmpPath (removePath <=< toFSFilePath)
|
||||
flip catchAllErrors (\e -> logError $ "XFTP rcv worker error: " <> tshow e) $
|
||||
lift $ forM_ tmpPath (removePath <=< toFSFilePath)
|
||||
liftIO $ waitUntilForeground c
|
||||
withStore' c (`updateRcvFileComplete` rcvFileId)
|
||||
Just RcvFileRedirect {redirectFileInfo, redirectDbId} -> do
|
||||
|
||||
@@ -652,7 +652,13 @@ getProtocolClient g nm transportSession@(_, srv, _) cfg@ProtocolClientConfig {qS
|
||||
writeTVar (connected c) True
|
||||
putTMVar cVar $ Right c'
|
||||
raceAny_ ([send c' th, process c', receive c' th] <> [monitor c' | smpPingInterval > 0])
|
||||
`E.finally` disconnected c'
|
||||
`E.finally` (failPendingRequests c >> disconnected c')
|
||||
|
||||
failPendingRequests :: PClient v err msg -> IO ()
|
||||
failPendingRequests PClient {sentCommands} = atomically $ do
|
||||
rs <- swapTVar sentCommands mempty
|
||||
forM_ rs $ \Request {pending, responseVar} ->
|
||||
whenM (swapTVar pending False) $ void $ tryPutTMVar responseVar $ Left $ PCENetworkError NEFailedError
|
||||
|
||||
send :: Transport c => ProtocolClient v err msg -> THandle v c 'TClient -> IO ()
|
||||
send ProtocolClient {client_ = PClient {sndQ}} h = forever $ atomically (readTBQueue sndQ) >>= sendPending
|
||||
|
||||
Reference in new issue
Block a user