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:
Evgeny Poberezkin authored and GitHub committed 2021-12-15 08:06:34 +00:00
1 parent 83d352cfbe
commit cf3d0dfdc3
9 files changed
+351 -272

No files matched your search

+4 -4
View File
@@ -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)