splice 0.3.1 → 0.3.2
raw patch · 4 files changed
+23/−17 lines, 4 files
Files
- splice.cabal +6/−6
- src/Network/Socket/Splice.hs +2/−2
- src/Network/Socket/Splice/Internal.hsc +9/−4
- src/System/IO/Splice/Linux.hsc +6/−5
splice.cabal view
@@ -1,15 +1,15 @@ name: splice-version: 0.3.1-stability: stable on Linux, experimental on other operating systems+version: 0.3.2+stability: stable on GNU/Linux, experimental on other operating systems synopsis: Socket to Socket Data Splicing (supports all operating systems) description: A library that implements most efficient socket to socket data transfer loops for proxy servers on each operating system. .- On Linux, it uses and exposes the zero-copy @splice()@ system+ On GNU/Linux, it uses and exposes the zero-copy @splice()@ system call: <http://kerneltrap.org/node/6505>. .- On other operating systems, it currently falls back to a portable- Haskell implementation.+ On all other operating systems, it currently falls back to a+ portable Haskell implementation. . [Corsis Research] This work is funded by Corsis Research@@ -24,7 +24,7 @@ license-file: LICENSE author: Cetin Sert <fusion@corsis.eu> maintainer: Cetin Sert <fusion@corsis.eu>-homepage: https://github.com/corsis/splice+homepage: http://corsis.github.com/splice/ category: Network build-type: Simple cabal-version: >=1.2
src/Network/Socket/Splice.hs view
@@ -2,7 +2,7 @@ This library implements most efficient socket to socket data transfer loops for proxy servers on each operating system. - On Linux, it uses and exposes the zero-copy @splice()@ system call:+ On GNU\/Linux, it uses and exposes the zero-copy @splice()@ system call: <http://kerneltrap.org/node/6505>. On other operating systems, it currently falls back to a portable Haskell@@ -18,7 +18,7 @@ -- License : BSD3 -- Maintainer : fusion@corsis.eu -- Stability : stable--- Portability : GHC-only, works on all OSes+-- Portability : GHC-only, works on all operating systems module Network.Socket.Splice (
src/Network/Socket/Splice/Internal.hsc view
@@ -1,5 +1,12 @@ -- | Implementation.+-- Module : Network.Socket.Splice.Internal+-- Copyright : (c) Cetin Sert 2012+-- License : BSD3+-- Maintainer : fusion@corsis.eu+-- Stability : stable+-- Portability : GHC-only, works on all operating systems + #ifdef LINUX_SPLICE #include <fcntl.h> #endif@@ -122,10 +129,8 @@ #else - s <- fdToHandle fdIn- t <- fdToHandle fdOut- hSetBuffering s NoBuffering- hSetBuffering t NoBuffering+ s <- fdToHandle fdIn ; hSetBuffering s NoBuffering+ t <- fdToHandle fdOut; hSetBuffering t NoBuffering a <- mallocBytes len :: IO (Ptr Word8) finally
src/System/IO/Splice/Linux.hsc view
@@ -3,7 +3,7 @@ /This module is only available (compiled & exposed) on Linux./ -} -- --- Module : Network.Socket.Splice+-- Module : System.IO.Splice.Linux -- Copyright : (c) Cetin Sert 2012 -- License : BSD3 -- Maintainer : fusion@corsis.eu@@ -63,14 +63,15 @@ sPLICE_F_MOVE = (#const "SPLICE_F_MOVE") --- | More data will be coming in a subsequent splice. This is a helpful hint+-- | More data will be coming in a subsequent 'c_splice'. This is a helpful hint -- when 'fd_out' refers to a socket. sPLICE_F_MORE :: Word sPLICE_F_MORE = (#const "SPLICE_F_MORE") --- | Do not block on I\/O. This makes the splice pipe operations nonblocking,--- but splice() may nevertheless block because the file descriptors that are--- spliced to\/from may block (unless they have the O_NONBLOCK flag set).+-- | Do not block on I\/O. This makes the 'c_splice' pipe operations+-- nonblocking, but 'c_splice' may nevertheless block because the file+-- descriptors that are 'c_splice'd to\/from may block (unless they have the+-- @O_NONBLOCK@ flag set). sPLICE_F_NONBLOCK :: Word sPLICE_F_NONBLOCK = (#const "SPLICE_F_NONBLOCK")