network-transport-tcp 0.8.3 → 0.8.4
raw patch · 4 files changed
+16/−19 lines, 4 filesnew-uploader
Files
- ChangeLog +4/−0
- network-transport-tcp.cabal +3/−3
- src/Network/Transport/TCP.hs +6/−1
- src/Network/Transport/TCP/Internal.hs +3/−15
ChangeLog view
@@ -1,3 +1,7 @@+2023-07-09 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.8.4++* Set TCP_NODELAY by default. The documentation erroneously reported it as the default. (#66)+ 2023-03-26 David Simmons-Duffin <dsd@caltech.edu> 0.8.3 * Disable a flaky test
network-transport-tcp.cabal view
@@ -1,5 +1,5 @@ Name: network-transport-tcp-Version: 0.8.3+Version: 0.8.4 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3@@ -12,7 +12,7 @@ Bug-Reports: https://github.com/haskell-distributed/network-transport-tcp/issues Synopsis: TCP instantiation of Network.Transport Description: TCP instantiation of Network.Transport-Tested-With: GHC==8.4.4 GHC==8.6.5 GHC==8.8.4+Tested-With: GHC==9.0.2 GHC==9.2.8 GHC==9.4.5 GHC==9.6.4 GHC==9.8.2 Category: Network extra-source-files: ChangeLog @@ -31,7 +31,7 @@ data-accessor >= 0.2 && < 0.3, containers >= 0.4 && < 0.7, bytestring >= 0.9 && < 0.13,- network >= 3.1 && < 3.2,+ network >= 3.1 && < 3.3, uuid >= 1.3 && < 1.4 Exposed-modules: Network.Transport.TCP, Network.Transport.TCP.Internal
src/Network/Transport/TCP.hs view
@@ -525,6 +525,7 @@ -- Defaults to True. , tcpNoDelay :: Bool -- | Should we set TCP_KEEPALIVE on connection sockets?+ -- Defaults to False. , tcpKeepAlive :: Bool -- | Value of TCP_USER_TIMEOUT in milliseconds , tcpUserTimeout :: Maybe Int@@ -536,6 +537,8 @@ -- -- Connection requests to this transport will also timeout if they don't -- send the required data before this many microseconds.+ --+ -- Defaults to Nothing (no timeout). , transportConnectTimeout :: Maybe Int -- | Create a QDisc for an EndPoint. , tcpNewQDisc :: forall t . IO (QDisc t)@@ -554,10 +557,12 @@ -- This is useful when operating on untrusted networks, because the peer -- could otherwise deny service to some victim by claiming the victim's -- address.+ -- Defaults to False. , tcpCheckPeerHost :: Bool -- | What to do if there's an exception when accepting a new TCP -- connection. Throwing an exception here will cause the server to -- terminate.+ -- Defaults to `throwIO`. , tcpServerExceptionHandler :: SomeException -> IO () } @@ -678,7 +683,7 @@ tcpBacklog = N.maxListenQueue , tcpReuseServerAddr = True , tcpReuseClientAddr = True- , tcpNoDelay = False+ , tcpNoDelay = True , tcpKeepAlive = False , tcpUserTimeout = Nothing , tcpNewQDisc = simpleUnboundedQDisc
src/Network/Transport/TCP/Internal.hs view
@@ -71,7 +71,7 @@ import qualified Network.Socket.ByteString as NBS (recv) #endif -import Data.Word (Word32, Word64)+import Data.Word (Word32) import Control.Monad (forever, when) import Control.Exception (SomeException, catch, bracketOnError, throwIO, mask_)@@ -82,27 +82,15 @@ , putMVar , readMVar )-import Control.Monad (forever, when) import Control.Exception- ( SomeException- , catch- , bracketOnError- , throwIO- , mask_- , mask+ ( mask , finally- , onException ) -import Control.Applicative ((<$>), (<*>))-import Data.Word (Word32) import Data.ByteString (ByteString) import qualified Data.ByteString as BS (length, concat, null) import Data.ByteString.Lazy.Internal (smallChunkSize)-import Data.ByteString.Lazy (toStrict) import qualified Data.ByteString.Char8 as BSC (unpack, pack)-import Data.ByteString.Builder (word64BE, toLazyByteString)-import Data.Monoid ((<>)) import qualified Data.UUID as UUID import qualified Data.UUID.V4 as UUID @@ -326,7 +314,7 @@ -- Will only give 'Just' for IPv4 addresses. resolveSockAddr :: N.SockAddr -> IO (Maybe (N.HostName, N.HostName, N.ServiceName)) resolveSockAddr sockAddr = case sockAddr of- N.SockAddrInet port host -> do+ N.SockAddrInet port _ -> do (mResolvedHost, mResolvedPort) <- N.getNameInfo [] True False sockAddr case (mResolvedHost, mResolvedPort) of (Just resolvedHost, Nothing) -> do