mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-10-23 19:32:26 +00:00
Transaction fields for size, session IDs, refactor (#222)
* add SMP session IDs/tls-unique to transmission * refactor SMP transmissions: precise transmission types in server & client * use correct session IDs * remove TSession
This commit is contained in:
1 parent
83d352cfbe
commit
cf3d0dfdc3
9 files changed
+351
-272
No files matched your search
+4
-4
@@ -171,11 +171,11 @@ smpTest4 _ test' = smpTestN 4 _test
|
||||
_test _ = error "expected 4 handles"
|
||||
|
||||
tPutRaw :: Transport c => THandle c -> SignedRawTransmission -> IO ()
|
||||
tPutRaw h (sig, corrId, queueId, command) = do
|
||||
let t = B.intercalate " " [corrId, queueId, command]
|
||||
tPutRaw h (sig, sessId, corrId, queueId, command) = do
|
||||
let t = B.unwords [sessId, corrId, queueId, command]
|
||||
void $ tPut h (sig, t)
|
||||
|
||||
tGetRaw :: Transport c => THandle c -> IO SignedRawTransmission
|
||||
tGetRaw h = do
|
||||
(Nothing, (CorrId corrId, qId, Right cmd)) <- tGet fromServer h
|
||||
pure (Nothing, corrId, encode qId, serializeCommand cmd)
|
||||
(Nothing, _, (SessionId sessId, CorrId corrId, qId, Right cmd)) <- tGet fromServer h
|
||||
pure (Nothing, sessId, corrId, encode qId, serializeCommand cmd)
|
||||
Reference in new issue
Block a user