diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-11-21 21:45:56 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-11-21 21:45:56 -0400 |
commit | 39b01141b8f24e780ba579c06adc80372a1b82d7 (patch) | |
tree | cd51f4bcac66ee631d9e6f797a8290073b3e5249 /Remote/Helper | |
parent | 3ea7198d9e0aea3f8764c0b991c18b09f32d2de1 (diff) |
detect EOF on socket and cleanly shutdown the service process
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/P2P/IO.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Remote/Helper/P2P/IO.hs b/Remote/Helper/P2P/IO.hs index 9cd2face3..76d07a11c 100644 --- a/Remote/Helper/P2P/IO.hs +++ b/Remote/Helper/P2P/IO.hs @@ -168,14 +168,14 @@ relayHelper runner v hin = loop return (Just exitcode) -- Takes input from the peer, and puts it into the MVar for processing. --- Repeats until the peer tells it it's done. +-- Repeats until the peer tells it it's done or hangs up. relayFeeder :: RunProto -> MVar RelayData -> IO () relayFeeder runner v = loop where loop = do mrd <- runner $ net relayFromPeer case mrd of - Nothing -> return () + Nothing -> putMVar v (RelayDone (ExitFailure 1)) Just rd -> do putMVar v rd case rd of |