http-client 0.3.7.2 → 0.3.8
raw patch · 4 files changed
+18/−4 lines, 4 files
Files
- Network/HTTP/Client.hs +2/−0
- Network/HTTP/Client/Connection.hs +4/−2
- Network/HTTP/Client/Manager.hs +11/−1
- http-client.cabal +1/−1
Network/HTTP/Client.hs view
@@ -85,6 +85,8 @@ , managerRetryableException , managerWrapIOException , managerIdleConnectionCount+ -- *** Helpers+ , rawConnectionModifySocket -- * Request , parseUrl , applyBasicAuth
Network/HTTP/Client/Connection.hs view
@@ -101,11 +101,12 @@ (sendAll socket) (sClose socket) -openSocketConnection :: Maybe HostAddress+openSocketConnection :: (Socket -> IO ())+ -> Maybe HostAddress -> String -- ^ host -> Int -- ^ port -> IO Connection-openSocketConnection hostAddress host port = do+openSocketConnection tweakSocket hostAddress host port = do let hints = NS.defaultHints { NS.addrFlags = [NS.AI_ADDRCONFIG] , NS.addrSocketType = NS.Stream@@ -132,6 +133,7 @@ (\sock -> do NS.setSocketOption sock NS.NoDelay 1 NS.connect sock (NS.addrAddress addr)+ tweakSocket sock socketConnection sock) firstSuccessful :: [NS.AddrInfo] -> (NS.AddrInfo -> IO a) -> IO a
Network/HTTP/Client/Manager.hs view
@@ -12,6 +12,7 @@ , getConn , failedConnectionException , defaultManagerSettings+ , rawConnectionModifySocket ) where #if !MIN_VERSION_base(4,6,0)@@ -47,13 +48,22 @@ import Network.HTTP.Client.Connection import Network.HTTP.Client.Headers (parseStatusHeaders) +-- | A value for the @managerRawConnection@ setting, but also allows you to+-- modify the underlying @Socket@ to set additional settings. For a motivating+-- use case, see: <https://github.com/snoyberg/http-client/issues/71>.+--+-- Since 0.3.8+rawConnectionModifySocket :: (NS.Socket -> IO ())+ -> IO (Maybe NS.HostAddress -> String -> Int -> IO Connection)+rawConnectionModifySocket = return . openSocketConnection+ -- | Default value for @ManagerSettings@. -- -- Since 0.1.0 defaultManagerSettings :: ManagerSettings defaultManagerSettings = ManagerSettings { managerConnCount = 10- , managerRawConnection = return openSocketConnection+ , managerRawConnection = return $ openSocketConnection (const $ return ()) , managerTlsConnection = return $ \_ _ _ -> throwIO TlsNotSupported , managerTlsProxyConnection = return $ \_ _ _ _ _ _ -> throwIO TlsNotSupported , managerResponseTimeout = Just 30000000
http-client.cabal view
@@ -1,5 +1,5 @@ name: http-client-version: 0.3.7.2+version: 0.3.8 synopsis: An HTTP client engine, intended as a base layer for more user-friendly packages. description: This codebase has been refactored from http-conduit. homepage: https://github.com/snoyberg/http-client