From 5ad221d0deb2fa92a50dfd64bea884b61ea706b0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 20 Mar 2013 13:18:12 -0400 Subject: 2 minor fixes to transferkeys, otherwise it was perfect 1st time! Needed to send a trailing NUL to end a request, and set the read handle non-blocking. Also, set fileSystemEncoding on all handles, since there's a filename in there. --- Command/TransferKeys.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Command') diff --git a/Command/TransferKeys.hs b/Command/TransferKeys.hs index 93415d5f3..2114e2278 100644 --- a/Command/TransferKeys.hs +++ b/Command/TransferKeys.hs @@ -66,7 +66,12 @@ runRequests -> Handle -> (TransferRequest -> Annex Bool) -> Annex () -runRequests readh writeh a = go =<< readrequests +runRequests readh writeh a = do + liftIO $ do + hSetBuffering readh NoBuffering + fileEncoding readh + fileEncoding writeh + go =<< readrequests where go (d:u:k:f:rest) = do case (deserialize d, deserialize u, deserialize k, deserialize f) of @@ -93,6 +98,7 @@ sendRequest t f h = do , serialize (transferUUID t) , serialize (transferKey t) , serialize f + , "" -- adds a trailing null ] hFlush h -- cgit v1.2.3