summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/TransferKeys.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Command/TransferKeys.hs b/Command/TransferKeys.hs
index 61f99555d..93415d5f3 100644
--- a/Command/TransferKeys.hs
+++ b/Command/TransferKeys.hs
@@ -86,16 +86,19 @@ runRequests readh writeh a = go =<< readrequests
hPutStrLn writeh $ serialize b
hFlush writeh
-sendRequest :: TransferRequest -> Handle -> IO ()
-sendRequest (TransferRequest d r k f) h = do
+sendRequest :: Transfer -> AssociatedFile -> Handle -> IO ()
+sendRequest t f h = do
hPutStr h $ join fieldSep
- [ serialize d
- , serialize $ Remote.uuid r
- , serialize k
+ [ serialize (transferDirection t)
+ , serialize (transferUUID t)
+ , serialize (transferKey t)
, serialize f
]
hFlush h
+readResponse :: Handle -> IO Bool
+readResponse h = fromMaybe False . deserialize <$> hGetLine h
+
fieldSep :: String
fieldSep = "\0"