packages feed

happstack-server 7.3.2 → 7.3.3

raw patch · 2 files changed

+13/−6 lines, 2 filesdep ~blaze-htmldep ~text

Dependency ranges changed: blaze-html, text

Files

happstack-server.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-server-Version:             7.3.2+Version:             7.3.3 Synopsis:            Web related tools and services. Description:         Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course <http://happstack.com/docs/crashcourse/index.html> License:             BSD3@@ -70,7 +70,7 @@    Build-Depends:       base >= 4 && < 5,                        base64-bytestring == 1.0.*,-                       blaze-html        >= 0.5 && < 0.7,+                       blaze-html        >= 0.5 && < 0.8,                        bytestring,                        containers,                        directory,@@ -86,7 +86,7 @@                        sendfile >= 0.7.1 && < 0.8,                        system-filepath >= 0.3.1,                        syb,-                       text >= 0.10 && < 1.1,+                       text >= 0.10 && < 1.2,                        time,                        time-compat,                        threads >= 0.5,
src/Happstack/Server/Internal/TimeoutSocket.hs view
@@ -18,8 +18,9 @@ import           Network.Socket (Socket, ShutdownCmd(..), shutdown) import           Network.Socket.SendFile (Iter(..), ByteCount, Offset, sendFileIterWith') import           Network.Socket.ByteString (sendAll)-import           System.IO.Error (isDoesNotExistError)+import           System.IO.Error (isDoesNotExistError, ioeGetErrorType) import           System.IO.Unsafe (unsafeInterleaveIO)+import           GHC.IO.Exception (IOErrorType(InvalidArgument))  sPutLazyTickle :: TM.Handle -> Socket -> L.ByteString -> IO () sPutLazyTickle thandle sock cs =@@ -41,8 +42,14 @@     s <- N.recv sock 65536     TM.tickle handle     if S.null s-      then do shutdown sock ShutdownReceive `E.catch` (\e -> when (not $ isDoesNotExistError e) (throw e))-              return L.Empty+      then do+        -- 'InvalidArgument' is GHCs code for eNOTCONN (among other+        -- things). Sometimes the other end of socket is closed first+        -- and this end is already disconnected before we do+        -- 'shutdown'. Ignore this exception.+        shutdown sock ShutdownReceive `E.catch`+                    (\e -> when (not (isDoesNotExistError e || ioeGetErrorType e == InvalidArgument)) (throw e))+        return L.Empty       else L.Chunk s `liftM` loop