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  3221916dc458aa76ad5137f4afa2ab7d55e1c9c2 (commit)
      from  b7dcd3732e4db1d6f819349abc33e30f66c40b56 (commit)


Summary of changes:
 src/Snap/Internal/Http/Server/LibevBackend.hs |   10 ++++++++--
 1 files changed, 8 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 3221916dc458aa76ad5137f4afa2ab7d55e1c9c2
Author: Shu-yu Guo <[email protected]>
Date:   Sun Jun 6 04:47:47 2010 -0700

    Temporary fix for SendFile timeout bug

diff --git a/src/Snap/Internal/Http/Server/LibevBackend.hs 
b/src/Snap/Internal/Http/Server/LibevBackend.hs
index 2b4238c..915d9be 100644
--- a/src/Snap/Internal/Http/Server/LibevBackend.hs
+++ b/src/Snap/Internal/Http/Server/LibevBackend.hs
@@ -117,8 +117,15 @@ sendFile c fp = do
       when act $ evIoStop loop io
       writeIORef (_writeActive c) False
       evAsyncSend loop asy
+      evTimerStop loop (_timerObj c)
 
+    -- FIXME
+    -- Temporary hack to stop sendFile from timing out.
+    -- An actual fix requires us to write our own sendfile wrapper that
+    -- checks for EINTR (will libev timers raise EINTR on sendfile?)
+    -- on OS X and just the return value on Linux to tickle the timeout.
     SF.sendFile s fp
+    tickleTimeout c
 
     withMVar lock $ \_ -> do
       tryTakeMVar $ _readAvailable c
@@ -349,7 +356,7 @@ getAddr addr =
 -- everything
 timerCallback :: MVar ThreadId -> TimerCallback
 timerCallback tmv _ _ _ = do
-    debug "timer callback"
+    debug "Backend.timerCallback: timed out"
     tid <- readMVar tmv
     throwTo tid TimeoutException
 
@@ -363,7 +370,6 @@ addThreadSetEdit backend edit = do
     return ()
 
 
-
 freeConnection :: Connection -> IO ()
 freeConnection conn = ignoreException $ do
     withMVar loopLock $ \_ -> block $ do
-----------------------------------------------------------------------


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

Reply via email to