remotedaemon: When network connection is lost, close all cached ssh connections.

This commit was sponsored by Cedric Staub.
This commit is contained in:
Joey Hess 2014-04-12 16:32:59 -04:00
parent 15917ec1a8
commit a33b30d0c4
7 changed files with 76 additions and 36 deletions

View file

@ -42,6 +42,7 @@ data Emitted
-- Messages that the deamon consumes.
data Consumed
= PAUSE
| LOSTNET
| RESUME
| CHANGED RefList
| RELOAD
@ -63,6 +64,7 @@ instance Proto.Sendable Emitted where
instance Proto.Sendable Consumed where
formatMessage PAUSE = ["PAUSE"]
formatMessage LOSTNET = ["LOSTNET"]
formatMessage RESUME = ["RESUME"]
formatMessage (CHANGED refs) =["CHANGED", Proto.serialize refs]
formatMessage RELOAD = ["RELOAD"]
@ -78,6 +80,7 @@ instance Proto.Receivable Emitted where
instance Proto.Receivable Consumed where
parseCommand "PAUSE" = Proto.parse0 PAUSE
parseCommand "LOSTNET" = Proto.parse0 LOSTNET
parseCommand "RESUME" = Proto.parse0 RESUME
parseCommand "CHANGED" = Proto.parse1 CHANGED
parseCommand "RELOAD" = Proto.parse0 RELOAD