This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-server".

The branch, master has been updated
       via  f5a950c6738286b5ffee5f9dc09ba12bf2e678fb (commit)
      from  1858e139da23f034e4005eba5d68c9852092a796 (commit)


Summary of changes:
 src/Snap/Internal/Http/Server/LibevBackend.hs |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f5a950c6738286b5ffee5f9dc09ba12bf2e678fb
Author: Gregory Collins <[email protected]>
Date:   Sat Apr 30 00:27:54 2011 +0200

    Eat more exceptions in libev backend

diff --git a/src/Snap/Internal/Http/Server/LibevBackend.hs 
b/src/Snap/Internal/Http/Server/LibevBackend.hs
index 0b6ce46..4376a46 100644
--- a/src/Snap/Internal/Http/Server/LibevBackend.hs
+++ b/src/Snap/Internal/Http/Server/LibevBackend.hs
@@ -112,10 +112,10 @@ libEvEventLoop defaultTimeout sockets cap elog handler = 
do
                              [0..(cap-1)]
 
     debug "libevEventLoop: waiting for loop exit"
-    Prelude.mapM_ (takeMVar . _loopExit) backends `finally` do
-        debug "libevEventLoop: stopping all backends"
-        mapM stop backends
-        mapM Listen.closeSocket sockets
+    ignoreException (Prelude.mapM_ (takeMVar . _loopExit) backends)
+    debug "libevEventLoop: stopping all backends"
+    ignoreException $ mapM stop backends
+    ignoreException $ mapM Listen.closeSocket sockets
 
 
 ------------------------------------------------------------------------------
@@ -382,11 +382,6 @@ freeConnection conn = ignoreException $ do
 
 
 ------------------------------------------------------------------------------
-ignoreException :: IO () -> IO ()
-ignoreException = handle (\(_::SomeException) -> return ())
-
-
-------------------------------------------------------------------------------
 freeBackend :: Backend -> IO ()
 freeBackend backend = ignoreException $ block $ do
     -- note: we only get here after an unloop, so we have the loop lock
@@ -527,8 +522,8 @@ runSession defaultTimeout backend handler lsock fd = do
             (\session -> block $ do
                 debug "runSession: thread killed, closing socket"
 
-                eatException $ Listen.endSession lsock session
-                eatException $ freeConnection conn
+                ignoreException $ Listen.endSession lsock session
+                ignoreException $ freeConnection conn
             )
             (\session -> do H.update tid conn (_connectionThreads backend)
                             handler sinfo
@@ -540,8 +535,9 @@ runSession defaultTimeout backend handler lsock fd = do
 
 
 ------------------------------------------------------------------------------
-eatException :: IO a -> IO ()
-eatException act = (act >> return ()) `catch` \(_::SomeException) -> return ()
+ignoreException :: IO a -> IO ()
+ignoreException act =
+    (act >> return ()) `catch` \(_::SomeException) -> return ()
 
 
 ------------------------------------------------------------------------------
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to