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 18b1037d8d450a59d5969ef40b2af23f06141f82 (commit)
from 7c93340f521286ada42a6acd4b28d12dfe8af656 (commit)
Summary of changes:
src/Snap/Internal/Http/Server/SimpleBackend.hs | 6 ++++--
1 files changed, 4 insertions(+), 2 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 18b1037d8d450a59d5969ef40b2af23f06141f82
Author: Gregory Collins <[email protected]>
Date: Thu Mar 31 11:46:29 2011 +0200
Stop simple backend from immediately crash-bombing
diff --git a/src/Snap/Internal/Http/Server/SimpleBackend.hs
b/src/Snap/Internal/Http/Server/SimpleBackend.hs
index 9348800..0175ada 100644
--- a/src/Snap/Internal/Http/Server/SimpleBackend.hs
+++ b/src/Snap/Internal/Http/Server/SimpleBackend.hs
@@ -83,7 +83,7 @@ newLoop defaultTimeout sockets handler elog cpu = do
tmgr <- TM.initialize defaultTimeout getCurrentDateTime
exit <- newEmptyMVar
accThreads <- forM sockets $ \p -> forkOnIO cpu $
- acceptThread defaultTimeout handler tmgr elog cpu p
+ acceptThread defaultTimeout handler tmgr elog cpu p exit
return $ EventLoopCpu cpu accThreads tmgr exit
@@ -102,8 +102,10 @@ acceptThread :: Int
-> (S.ByteString -> IO ())
-> Int
-> ListenSocket
+ -> MVar ()
-> IO ()
-acceptThread defaultTimeout handler tmgr elog cpu sock = loop
+acceptThread defaultTimeout handler tmgr elog cpu sock exitMVar =
+ loop `finally` (tryPutMVar exitMVar () >> return ())
where
loop = do
debug $ "acceptThread: calling accept() on socket " ++ show sock
-----------------------------------------------------------------------
hooks/post-receive
--
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap