diff options
author | Haskell Guy <haskell.guy@localhost> | 2020-05-28 12:40:39 +0200 |
---|---|---|
committer | Haskell Guy <haskell.guy@localhost> | 2020-05-28 12:40:39 +0200 |
commit | 604b736a8feac6736c4e01a85e0983699ebb1b6d (patch) | |
tree | a229d526348d38646358f5bebc546940536aaa42 /src/Ssb/Peer/RPC.hs | |
parent | 41cde99ec6189dbecca6803a5aa4f6f18142e8ba (diff) | |
download | ssb-haskell-604b736a8feac6736c4e01a85e0983699ebb1b6d.tar.xz |
Make slightly less verbose
Remove not needed printing to stdout and replace 'print's with putStrLn
to avoid surrounding output with quotation marks.
Diffstat (limited to 'src/Ssb/Peer/RPC.hs')
-rw-r--r-- | src/Ssb/Peer/RPC.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Ssb/Peer/RPC.hs b/src/Ssb/Peer/RPC.hs index e5a4c9a..3286a33 100644 --- a/src/Ssb/Peer/RPC.hs +++ b/src/Ssb/Peer/RPC.hs @@ -358,7 +358,7 @@ withM demuxer handler = with <$> demuxer <*> handler logMsg :: ConnState -> Text -> IO () logMsg conn msg = do _ <- atomically $ takeTMVar (lock conn) - print msg + putStrLn msg atomically $ putTMVar (lock conn) True logDebug :: ConnState -> Text -> IO () @@ -406,13 +406,9 @@ connect boxConn handler peer client = do forkIO $ -- make RPC calls on the peer client conn - print "entering service loop" ret <- serviceLoop conn - print "out of service loop" _ <- notifyDisconnect handler (connPeer conn) - print "disconnecting" disconnect conn - print "disconnected" return ret where serviceLoop conn = do @@ -564,15 +560,15 @@ handleMessage handler conn msg = do putTMVar (streamsIn conn) table' return . return $ () case err of - Left msg -> do - print msg + Left err -> do + putStrLn err return False Right _ -> do -- Serving a request call, how do we close it nicely? let endpoint = Endpoint (name req) (typ req) spawnConnection stream $ (serve handler) endpoint (args req) stream return True - where errTooManyRequests = "connection limit reached, dropping request" + where errTooManyRequests = "connection limit reached, dropping request" :: Text demux conn msg = do let reqNum = requestNumber . header $ msg |