diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-13 12:31:20 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-13 12:31:20 -0400 |
| commit | adffd9c76dec8de90407da98fb2c8e25c1d4e815 (patch) | |
| tree | 151a36bf2448793a995283655873ed093681843d /src/Propellor/Protocol.hs | |
| parent | 4a965c7b06b741b5de105e86d08228dfc9768ecc (diff) | |
| parent | e952199fbe22af6e6c29a8c7d60c03cde685f63e (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Protocol.hs')
| -rw-r--r-- | src/Propellor/Protocol.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index ae7e0404..e90155f3 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -53,11 +53,7 @@ sendMarked' h marker s = do hFlush h getMarked :: Handle -> Marker -> IO (Maybe String) -getMarked h marker = do - -- Avoid buffering anything in Handle, so that the data after - -- the marker will be available to be read from the underlying Fd. - hSetBuffering stdin NoBuffering - go =<< catchMaybeIO (hGetLine h) +getMarked h marker = go =<< catchMaybeIO (hGetLine h) where go Nothing = return Nothing go (Just l) = case fromMarked marker l of @@ -69,8 +65,8 @@ getMarked h marker = do debug ["received marked", marker] return (Just v) -reqMarked :: Stage -> Marker -> (String -> IO ()) -> IO () -reqMarked stage marker a = do +req :: Stage -> Marker -> (String -> IO ()) -> IO () +req stage marker a = do debug ["requested marked", marker] sendMarked' stdout statusMarker (show stage) maybe noop a =<< getMarked stdin marker |
