I must have been on drugs when wrote it
authorunc0rr
Mon, 14 Mar 2011 20:04:51 +0300
changeset 5011 73c5839d4447
parent 5010 af4e205e4b5a
child 5012 8767878e08e2
I must have been on drugs when wrote it
gameServer/ClientIO.hs
--- a/gameServer/ClientIO.hs	Sun Mar 13 20:34:27 2011 +0300
+++ b/gameServer/ClientIO.hs	Mon Mar 14 20:04:51 2011 +0300
@@ -46,10 +46,8 @@
         sendPacket packet = writeChan chan $ ClientMessage (ci, packet)
 
 clientRecvLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO ()
-clientRecvLoop s chan ci = Exception.block $
-        ((Exception.unblock $ listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show) >>= clientOff)
-    `Exception.finally`
-        remove
+clientRecvLoop s chan ci =
+        (Exception.unblock $ listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show) >>= clientOff >> remove
     where
         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
         remove = writeChan chan $ Remove ci