sendfile 0.7.7 → 0.7.8
raw patch · 3 files changed
+7/−7 lines, 3 files
Files
- sendfile.cabal +1/−1
- src/Network/Socket/SendFile/Darwin.hsc +4/−4
- src/Network/Socket/SendFile/Win32.hsc +2/−2
sendfile.cabal view
@@ -1,5 +1,5 @@ name: sendfile-version: 0.7.7+version: 0.7.8 stability: provisional synopsis: A portable sendfile library description: A library which exposes zero-copy sendfile functionality in a portable way. If a platform does not support sendfile, a fallback implementation in haskell is provided.
src/Network/Socket/SendFile/Darwin.hsc view
@@ -4,16 +4,16 @@ import Data.Int (Int64) import Foreign.C.Error (eAGAIN, eINTR, getErrno, throwErrno)-import Foreign.C.Types (CInt)+import Foreign.C.Types (CInt(..)) import Foreign.Marshal (alloca) import Foreign.Ptr (Ptr, nullPtr) import Foreign.Storable (peek, poke) import Network.Socket.SendFile.Iter (Iter(..), runIter)-import System.Posix.Types (Fd)+import System.Posix.Types (Fd(..)) #include <stdio.h> _sendFile :: Fd -> Fd -> Int64 -> Int64 -> IO ()-_sendFile out_fd in_fd off count = +_sendFile out_fd in_fd off count = do _ <- runIter (sendFileIter out_fd in_fd count off count) -- set blockSize == count. ie. send it all if we can. return () @@ -58,7 +58,7 @@ -- NOTE: should we retry automatically on EINTR (but not EAGAIN) sendfileI :: Fd -> Fd -> Int64 -> Ptr Int64 -> IO (Bool, Int64)-sendfileI out_fd in_fd off len = +sendfileI out_fd in_fd off len = do status <- c_sendfile out_fd in_fd off len if (status == 0) then do nsent <- peek len
src/Network/Socket/SendFile/Win32.hsc view
@@ -4,12 +4,12 @@ import Data.Bits ((.|.)) import Data.Int import Foreign.C.Error (throwErrnoIf)-import Foreign.C.Types (CInt)+import Foreign.C.Types (CInt(..)) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (IntPtr, Ptr, intPtrToPtr, nullPtr) import Foreign.Storable (peek) import Network.Socket.SendFile.Iter (Iter(..),runIter)-import System.Posix.Types (Fd)+import System.Posix.Types (Fd(..)) import System.Win32.Types (DWORD, HANDLE, failIfZero) #include <windows.h>