@@ -42,6 +42,12 @@ type WorkerHelper m
4242 )
4343 = > StoreRequest a -> m a
4444
45+ chatty :: Bool
46+ chatty = False
47+
48+ dbg :: MonadIO m => Text -> m ()
49+ dbg = when chatty . liftIO . Data.Text.IO. putStrLn
50+
4551-- | Run an emulated nix daemon on given socket address.
4652-- The deamon will close when the continuation returns.
4753runProxyDaemon
@@ -57,12 +63,12 @@ runProxyDaemon
5763runProxyDaemon workerHelper postGreet lsock k = do
5864 liftIO $ listen lsock maxListenQueue
5965
60- liftIO $ Data.Text.IO. putStrLn " listening"
66+ dbg " listening"
6167
6268 let listener :: m Void
6369 listener = do
6470 (sock, _) <- liftIO $ accept lsock
65- liftIO $ Data.Text.IO. putStrLn " accepting"
71+ dbg " accepting"
6672
6773 -- TODO: this, but without the space leak
6874 fmap fst
@@ -160,7 +166,7 @@ processConnection workerHelper postGreet sock = do
160166 loop
161167 loop
162168
163- liftIO $ Data.Text.IO. putStrLn " daemon connection done"
169+ dbg " daemon connection done"
164170 liftIO $ close sock
165171
166172 where
@@ -176,7 +182,6 @@ processConnection workerHelper postGreet sock = do
176182 RemoteStoreError_SerializerHandshake
177183 workerMagic
178184
179- liftIO $ print (" magic" :: Text , magic )
180185 when (magic /= WorkerMagic_One )
181186 $ throwError
182187 $ RemoteStoreError_WorkerException
@@ -195,8 +200,6 @@ processConnection workerHelper postGreet sock = do
195200
196201 let leastCommonVersion = min clientVersion serverHandshakeInputOurVersion
197202
198- liftIO $ print (" Versions client, min" :: Text , clientVersion , leastCommonVersion )
199-
200203 when (clientVersion < ProtoVersion 1 10 )
201204 $ throwError
202205 $ RemoteStoreError_WorkerException
0 commit comments