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  b082b4c3b2aa49edf26fc4a8acf1e13171e5f4d7 (commit)
       via  43fe0d655e0bb55600a9df97182ac513c273a262 (commit)
      from  db4275518b91c6b48a3820ea6165947bfac70325 (commit)


Summary of changes:
 snap-server.cabal                               |    4 +-
 src/Snap/Internal/Http/Server.hs                |    2 +
 src/Snap/Internal/Http/Server/LibevBackend.hsc  |   24 ++++++++++++----------
 src/Snap/Internal/Http/Server/SimpleBackend.hsc |    5 ++++
 4 files changed, 22 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 b082b4c3b2aa49edf26fc4a8acf1e13171e5f4d7
Author: Shu-yu Guo <[email protected]>
Date:   Tue May 25 14:12:55 2010 -0700

    Add Backend.name for logging

diff --git a/src/Snap/Internal/Http/Server.hs b/src/Snap/Internal/Http/Server.hs
index 026d328..8e064a0 100644
--- a/src/Snap/Internal/Http/Server.hs
+++ b/src/Snap/Internal/Http/Server.hs
@@ -104,6 +104,8 @@ httpServe bindAddress bindPort localHostname alogPath 
elogPath handler =
 
   where
     spawnAll alog elog = {-# SCC "httpServe/spawnAll" #-} do
+        logE elog $ S.concat [ "Server.httpServe: START ("
+                             , Backend.name, ")"]
         let n = numCapabilities
         bracket (spawn n)
                 (\xs -> do
diff --git a/src/Snap/Internal/Http/Server/LibevBackend.hsc 
b/src/Snap/Internal/Http/Server/LibevBackend.hsc
index c71aeb5..3792765 100644
--- a/src/Snap/Internal/Http/Server/LibevBackend.hsc
+++ b/src/Snap/Internal/Http/Server/LibevBackend.hsc
@@ -10,6 +10,7 @@ module Snap.Internal.Http.Server.LibevBackend
 , BackendTerminatedException
 , Connection
 , TimeoutException
+, name
 , debug
 , bindIt
 , new
@@ -100,6 +101,10 @@ data Connection = Connection
     , _connThread          :: MVar ThreadId
     }
 
+{-# INLINE name #-}
+name :: ByteString
+name = "libev"
+
 
 sendFile :: Connection -> FilePath -> IO ()
 sendFile c fp = do
diff --git a/src/Snap/Internal/Http/Server/SimpleBackend.hsc 
b/src/Snap/Internal/Http/Server/SimpleBackend.hsc
index 70865f0..09b73c0 100644
--- a/src/Snap/Internal/Http/Server/SimpleBackend.hsc
+++ b/src/Snap/Internal/Http/Server/SimpleBackend.hsc
@@ -9,6 +9,7 @@ module Snap.Internal.Http.Server.SimpleBackend
 , BackendTerminatedException
 , Connection
 , TimeoutException
+, name
 , debug
 , bindIt
 , new
@@ -72,6 +73,10 @@ data Connection = Connection
     , _localAddr   :: ByteString
     , _localPort   :: Int }
 
+{-# INLINE name #-}
+name :: ByteString
+name = "simple"
+
 
 sendFile :: Connection -> FilePath -> IO ()
 sendFile c fp = do
commit 43fe0d655e0bb55600a9df97182ac513c273a262
Author: Shu-yu Guo <[email protected]>
Date:   Tue May 25 14:03:18 2010 -0700

    Remove foreign import, use hlibev >= 0.2.3, bump version #

diff --git a/snap-server.cabal b/snap-server.cabal
index 7193fec..141c924 100644
--- a/snap-server.cabal
+++ b/snap-server.cabal
@@ -1,5 +1,5 @@
 name:           snap-server
-version:        0.2.3
+version:        0.2.4
 synopsis:       A fast, iteratee-based, epoll-enabled web server for the Snap 
Framework
 description:
   This is the first developer prerelease of the Snap framework.  Snap is a
@@ -114,7 +114,7 @@ Library
     vector >= 0.6 && <0.7
 
   if flag(libev)
-    build-depends: hlibev >= 0.2.2
+    build-depends: hlibev >= 0.2.3
     other-modules: Snap.Internal.Http.Server.LibevBackend
     cpp-options: -DLIBEV
   else
diff --git a/src/Snap/Internal/Http/Server/LibevBackend.hsc 
b/src/Snap/Internal/Http/Server/LibevBackend.hsc
index 957aef0..c71aeb5 100644
--- a/src/Snap/Internal/Http/Server/LibevBackend.hsc
+++ b/src/Snap/Internal/Http/Server/LibevBackend.hsc
@@ -55,8 +55,6 @@ import           System.Timeout
 import           Snap.Iteratee
 import           Snap.Internal.Debug
 
-#include <ev.h>
-
 
 data Backend = Backend
     { _acceptSocket      :: Socket
@@ -575,6 +573,13 @@ getHostAddr p s = do
 bLOCKSIZE :: Int
 bLOCKSIZE = 8192
 
+--
+-- About timeouts
+--
+-- It's not good enough to restart the timer from io(Read|Write)Callback,
+-- because those seem to be edge-triggered. I've definitely had where after
+-- 20 seconds they still weren't being re-awakened.
+--
 
 data TimeoutException = TimeoutException
    deriving (Typeable)
@@ -585,14 +590,6 @@ instance Show TimeoutException where
 instance Exception TimeoutException
 
 
--- FIXME We need Aycan to give us a binding for ev_timer_again.
---
--- Note that it's not good enough to call this from io(Read|Write)Callback,
--- because those seem to be edge-triggered. I've definitely had where after
--- 20 seconds they still weren't being re-awakened.
-foreign import ccall unsafe "ev_timer_again" evTimerAgain :: EvLoopPtr -> 
EvTimerPtr -> IO ()
-
-
 recvData :: Connection -> Int -> IO ByteString
 recvData conn n = do
     dbg "entered"
@@ -734,7 +731,7 @@ writeOut conn = IterateeG out
                             :: IO (Either SomeException ()))
 
         case ee of
-          -- XXX Should we really be returning Done () here?
+          -- XXX How do we signal to Server that an exception has occurred?
           (Left e)  -> return $ Done () (EOF $ Just $ Err $ show e)
           (Right _) -> return $ Cont (writeOut conn) Nothing
 
-----------------------------------------------------------------------


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

Reply via email to