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  c25074e2a035110763d1f31e44632c7e978f476b (commit)
      from  169a966ae04fd669fc5615161ba4f246df64711c (commit)


Summary of changes:
 src/Snap/Internal/Http/Server/LibevBackend.hsc  |   12 ++++++++----
 src/Snap/Internal/Http/Server/SimpleBackend.hsc |    1 -
 2 files changed, 8 insertions(+), 5 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 c25074e2a035110763d1f31e44632c7e978f476b
Author: Gregory Collins <[email protected]>
Date:   Tue May 25 00:20:48 2010 -0400

    Debug output, kill second close()

diff --git a/src/Snap/Internal/Http/Server/LibevBackend.hsc 
b/src/Snap/Internal/Http/Server/LibevBackend.hsc
index 0cdb0f1..d8dd4bd 100644
--- a/src/Snap/Internal/Http/Server/LibevBackend.hsc
+++ b/src/Snap/Internal/Http/Server/LibevBackend.hsc
@@ -37,6 +37,7 @@ import           Data.ByteString (ByteString)
 import           Data.ByteString.Internal (c2w, w2c)
 import qualified Data.ByteString.Unsafe as B
 import qualified Data.ByteString as B
+import qualified Data.ByteString.Char8 as BC
 import           Data.IORef
 import           Data.Iteratee.WrappedByteString
 import           Data.Set (Set)
@@ -343,7 +344,6 @@ freeConnection conn = ignoreException $ do
         -- close socket (twice to get proper linger behaviour)
         debug $ "freeConnection (" ++ show fd ++ ")"
         c_close fd
-        c_close fd
 
         -- stop and free timer object
         evTimerStop loop timerObj
@@ -638,11 +638,15 @@ sendData conn bs = do
                    (c_write fd cstr (toEnum len))
                    waitForLock
 
-    dbg $ "wrote " ++ show written ++ " bytes"
-
     let n = fromEnum written
+    let last10 = B.drop (n-10) $ B.take n bs
+
+    dbg $ "wrote " ++ show written ++ " bytes, last 10='" ++ show last10 ++ "'"
+
     if n < len
-       then sendData conn $ B.drop n bs
+       then do
+         dbg $ "short write, need to write " ++ show (len-n) ++ " more bytes"
+         sendData conn $ B.drop n bs
        else return ()
 
   where
diff --git a/src/Snap/Internal/Http/Server/SimpleBackend.hsc 
b/src/Snap/Internal/Http/Server/SimpleBackend.hsc
index 5a9cec7..70865f0 100644
--- a/src/Snap/Internal/Http/Server/SimpleBackend.hsc
+++ b/src/Snap/Internal/Http/Server/SimpleBackend.hsc
@@ -152,7 +152,6 @@ withConnection (Backend asock) cpu proc = do
                      debug "sClose sock"
                      eatException $ shutdown sock ShutdownBoth
                      eatException $ sClose sock
-                     eatException $ sClose sock
                 )
                 proc
 
-----------------------------------------------------------------------


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

Reply via email to