core: update simplexmq (connection-level locks) (#1170)

* core: update simplexmq (connection-level locks)

* update simplexmq

* update simplexmq

* update simplexmq

* only run file tests

* update simplexmq

* enable all tests

* update simplexmq
This commit is contained in:
Evgeny Poberezkin
2022-10-04 17:19:00 +01:00
committed by GitHub
parent f9c691cab1
commit 7a54351f15
4 changed files with 6 additions and 10 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ constraints: zip +disable-bzip2 +disable-zstd
source-repository-package
type: git
location: https://github.com/simplex-chat/simplexmq.git
tag: b686bc0c177af1e232a8e9b4bab4ed487c02eb12
tag: 0fa40fbfb0d578499679a2a5f21d7d9d2da20ee3
source-repository-package
type: git
+1 -1
View File
@@ -1,5 +1,5 @@
{
"https://github.com/simplex-chat/simplexmq.git"."b686bc0c177af1e232a8e9b4bab4ed487c02eb12" = "1w7af7cqfzcis1gs4hm7frcj15h1ri4sjnm45rh5j5llsm4chvvg";
"https://github.com/simplex-chat/simplexmq.git"."0fa40fbfb0d578499679a2a5f21d7d9d2da20ee3" = "116np2msr1pvr5x132aqm5hi5vr2d0gw7y9gfp8q5bi7fb2rdzkh";
"https://github.com/simplex-chat/direct-sqlcipher.git"."34309410eb2069b029b8fc1872deb1e0db123294" = "0kwkmhyfsn2lixdlgl15smgr1h5gjk7fky6abzh8rng2h5ymnffd";
"https://github.com/simplex-chat/sqlcipher-simple.git"."5e154a2aeccc33ead6c243ec07195ab673137221" = "1d1gc5wax4vqg0801ajsmx1sbwvd9y7p7b8mmskvqsmpbwgbh0m0";
"https://github.com/simplex-chat/aeson.git"."3eb66f9a68f103b5f1489382aad89f5712a64db7" = "0kilkx59fl6c3qy3kjczqvm8c3f4n3p0bdk9biyflf51ljnzp4yp";
+3 -7
View File
@@ -993,9 +993,7 @@ processChatCommand = \case
QuitChat -> liftIO exitSuccess
ShowVersion -> pure $ CRVersionInfo versionNumber
where
withChatLock action = do
ChatController {chatLock = l, smpAgent = a} <- ask
withAgentLock a . withLock l $ action
withChatLock action = asks chatLock >>= (`withLock` action)
-- below code would make command responses asynchronous where they can be slow
-- in View.hs `r'` should be defined as `id` in this case
-- procCmd :: m ChatResponse -> m ChatResponse
@@ -1377,10 +1375,8 @@ subscribeUserConnections agentBatchSubscribe user = do
void . forkIO $ do
threadDelay 1000000
l <- asks chatLock
a <- asks smpAgent
when (fileStatus == FSConnected) . unlessM (isFileActive fileId sndFiles) $
withAgentLock a . withLock l $
sendFileChunk user ft
when (fileStatus == FSConnected) . unlessM (isFileActive fileId sndFiles) . withLock l $
sendFileChunk user ft
rcvFileSubsToView :: Map ConnId (Either AgentErrorType ()) -> Map ConnId RcvFileTransfer -> m ()
rcvFileSubsToView rs = mapM_ (toView . uncurry CRRcvFileSubError) . filterErrors . resultsFor rs
pendingConnSubsToView :: Map ConnId (Either AgentErrorType ()) -> Map ConnId PendingContactConnection -> m ()
+1 -1
View File
@@ -49,7 +49,7 @@ extra-deps:
# - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561
# - ../simplexmq
- github: simplex-chat/simplexmq
commit: b686bc0c177af1e232a8e9b4bab4ed487c02eb12
commit: 0fa40fbfb0d578499679a2a5f21d7d9d2da20ee3
# - ../direct-sqlcipher
- github: simplex-chat/direct-sqlcipher
commit: 34309410eb2069b029b8fc1872deb1e0db123294