add missing flush-pkt after version

This commit is contained in:
Joey Hess 2018-08-13 14:02:12 -04:00
parent d963d40815
commit 7a1a3ef11f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -78,7 +78,7 @@ handshake selectrole selectcapability input output =
Left e -> return (Left e) Left e -> return (Left e)
Right myrole -> sendpkt rolePkt myrole $ Right myrole -> sendpkt rolePkt myrole $
sendpkt versionPkt (Version "2") $ do sendpkt versionPkt (Version "2") $ do
hFlush output sendflush
exchangecaps $ \mycaps -> return $ exchangecaps $ \mycaps -> return $
Right (myrole, mycaps) Right (myrole, mycaps)
where where
@ -91,9 +91,12 @@ handshake selectrole selectcapability input output =
Nothing -> return $ Left $ Nothing -> return $ Left $
"failed constructing pkt-line packet for: " ++ show v "failed constructing pkt-line packet for: " ++ show v
sendpkts _ [] cnt = do sendflush = do
writePktLine output flushPkt writePktLine output flushPkt
hFlush output hFlush output
sendpkts _ [] cnt = do
sendflush
cnt cnt
sendpkts f (v:vs) cnt = sendpkt f v $ sendpkts f vs cnt sendpkts f (v:vs) cnt = sendpkt f v $ sendpkts f vs cnt