diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-13 11:10:27 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-13 11:10:27 -0400 |
| commit | 043cd2218efb8e3d2f04ae2faff38293a01ed0c5 (patch) | |
| tree | 6a65363f435863139950616cc12ca7ef74042fdf /src/Propellor/Protocol.hs | |
| parent | 62202b9331f223c7a1dbd8385a2126e45058df83 (diff) | |
Revert "disable buffering earlier"
This reverts commit 632137836b39462883483a621f9dd696ce1d73cc.
Still failing :( Seems that disabling buffering is not the solution.
Diffstat (limited to 'src/Propellor/Protocol.hs')
| -rw-r--r-- | src/Propellor/Protocol.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index bc8d9327..ae7e0404 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -53,7 +53,11 @@ sendMarked' h marker s = do hFlush h getMarked :: Handle -> Marker -> IO (Maybe String) -getMarked h marker = go =<< catchMaybeIO (hGetLine h) +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) where go Nothing = return Nothing go (Just l) = case fromMarked marker l of |
