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 3cbcc2cf5392529734a7ef998e8fb11d48202045 (commit)
from dde133b6dfe0af305c50c905e33d553594e02977 (commit)
Summary of changes:
src/Snap/Internal/Http/Server.hs | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 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 3cbcc2cf5392529734a7ef998e8fb11d48202045
Author: Shu-yu Guo <[email protected]>
Date: Sun May 23 13:50:04 2010 -0700
Expose error logging to the Snap monad
diff --git a/src/Snap/Internal/Http/Server.hs b/src/Snap/Internal/Http/Server.hs
index d8399c2..678d355 100644
--- a/src/Snap/Internal/Http/Server.hs
+++ b/src/Snap/Internal/Http/Server.hs
@@ -52,7 +52,9 @@ import Snap.Internal.Http.Server.Date
--
-- Note that we won't be bothering end users with this -- the details will be
-- hidden inside the Snap monad
-type ServerHandler = Request -> Iteratee IO (Request,Response)
+type ServerHandler = Request
+ -> (ByteString -> IO ())
+ -> Iteratee IO (Request,Response)
type ServerMonad = StateT ServerState (Iteratee IO)
@@ -189,10 +191,8 @@ httpServe bindAddress bindPort localHostname alogPath
elogPath handler =
, bshow e ]
, Handler $ \(e :: SomeException) -> do
- logE elog $ S.concat [
- "Server.httpServe.go: got someexception: "
- , bshow e ]
- return () ]
+ logE elog $ S.concat [ "Server.httpServe.go: got someexception: "
+ , bshow e ] ]
------------------------------------------------------------------------------
debugE :: (MonadIO m) => ByteString -> m ()
@@ -252,7 +252,8 @@ runHTTP lh lip lp rip rp alog elog readEnd writeEnd
onSendFile handler =
, Handler $ \(_ :: Backend.TimeoutException) -> return ()
, Handler $ \(e :: SomeException) ->
- logE elog $ toBS $ Prelude.show e ]
+ logE elog $ S.concat [ "Server.runHTTP.go: got
someexception: "
+ , bshow e ] ]
where
go = do
@@ -286,7 +287,8 @@ httpSession writeEnd onSendFile handler = do
case mreq of
(Just req) -> do
- (req',rspOrig) <- lift $ handler req
+ logerr <- gets _logError
+ (req',rspOrig) <- lift $ handler req logerr
let rspTmp = rspOrig { rspHttpVersion = rqVersion req }
checkConnectionClose (rspHttpVersion rspTmp) (rspHeaders rspTmp)
-----------------------------------------------------------------------
hooks/post-receive
--
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap