summaryrefslogtreecommitdiff
path: root/src/Network/KRPC
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-01-27 08:50:51 -0500
committerjoe <joe@jerkface.net>2017-01-27 08:50:51 -0500
commit0d1de683de78a70ce9c054b444bb6f19c39d112c (patch)
treef3a57d89c0673ee949b4e3a1f28885fb621f78b0 /src/Network/KRPC
parent77a317310d4f7929335fafe3cfbf53afd45faa82 (diff)
More strictness.
Diffstat (limited to 'src/Network/KRPC')
-rw-r--r--src/Network/KRPC/Manager.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/KRPC/Manager.hs b/src/Network/KRPC/Manager.hs
index 22d111e2..66de6548 100644
--- a/src/Network/KRPC/Manager.hs
+++ b/src/Network/KRPC/Manager.hs
@@ -466,14 +466,14 @@ handleMessage raw (E e) = handleResponse raw (Left e)
466listener :: MonadKRPC h m => m () 466listener :: MonadKRPC h m => m ()
467listener = do 467listener = do
468 Manager {..} <- getManager 468 Manager {..} <- getManager
469 forever $ do 469 fix $ \again -> do
470 (bs, addr) <- liftIO $ do 470 (bs, addr) <- liftIO $ do
471 handle exceptions $ BS.recvFrom sock (optMaxMsgSize options) 471 handle exceptions $ BS.recvFrom sock (optMaxMsgSize options)
472
473 case BE.parse bs >>= \r -> (,) r <$> BE.decode bs of 472 case BE.parse bs >>= \r -> (,) r <$> BE.decode bs of
474 -- TODO ignore unknown messages at all? 473 -- TODO ignore unknown messages at all?
475 Left e -> liftIO $ sendMessage sock addr $ unknownMessage e 474 Left e -> liftIO $ sendMessage sock addr $ unknownMessage e
476 Right (raw,m) -> handleMessage raw m addr 475 Right (raw,m) -> handleMessage raw m addr
476 again
477 where 477 where
478 exceptions :: IOError -> IO (BS.ByteString, SockAddr) 478 exceptions :: IOError -> IO (BS.ByteString, SockAddr)
479 exceptions e 479 exceptions e