http2-client 0.9.0.0 → 0.10.0.0
raw patch · 5 files changed
+33/−9 lines, 5 filesdep ~basedep ~http2dep ~mtl
Dependency ranges changed: base, http2, mtl, network, time
Files
- ChangeLog.md +5/−0
- http2-client.cabal +3/−3
- src/Network/HTTP2/Client.hs +4/−3
- src/Network/HTTP2/Client/FrameConnection.hs +4/−3
- src/Network/HTTP2/Client/RawConnection.hs +17/−0
ChangeLog.md view
@@ -2,6 +2,11 @@ ## Unreleased changes +## v0.10.0.0++- Export frameHttp2RawConnection to convert an RawHttp2Connection into an Http2FrameConnection.+- Add newRawHttp2ConnectionUnix to create a RawHttp2Connection from a unix domain socket.+ ## v0.9.0.0 - introduce ClientIO as an error-carrying IO-monad for performing http2-calls
http2-client.cabal view
@@ -1,5 +1,5 @@ name: http2-client-version: 0.9.0.0+version: 0.10.0.0 synopsis: A native HTTP2 client library. description: Please read the README.md at the homepage. homepage: https://github.com/lucasdicioccio/http2-client@@ -27,11 +27,11 @@ , bytestring >= 0.10 && < 1 , containers >= 0.5 && < 1 , deepseq >= 1.4 && < 2- , http2 >= 1.6 && < 2+ , http2 >= 1.6 && < 2.1 , lifted-async >= 0.10 && < 0.11 , lifted-base >= 0.2 && < 0.3 , mtl >= 2.2 && < 3- , network >= 2.6 && < 3+ , network >= 2.6 && < 4 , stm >= 2.4 && < 3 , time >= 1.8 && < 2 , tls >= 1.4 && < 2
src/Network/HTTP2/Client.hs view
@@ -419,10 +419,11 @@ goAwayHandler fallbackHandler - let baseWindowSize = return HTTP2.defaultInitialWindowSize- _initIncomingFlowControl <- lift $ newIncomingFlowControl dispatchControl baseWindowSize (sendWindowUpdateFrame controlStream)+ let baseIncomingWindowSize = initialWindowSize . _clientSettings <$> readSettings dispatchControl+ baseOutgoingWindowSize = initialWindowSize . _serverSettings <$> readSettings dispatchControl+ _initIncomingFlowControl <- lift $ newIncomingFlowControl dispatchControl baseIncomingWindowSize (sendWindowUpdateFrame controlStream) windowUpdatesChan <- newChan- _initOutgoingFlowControl <- lift $ newOutgoingFlowControl dispatchControl windowUpdatesChan baseWindowSize+ _initOutgoingFlowControl <- lift $ newOutgoingFlowControl dispatchControl windowUpdatesChan baseOutgoingWindowSize dispatchHPACK <- newDispatchHPACKIO decoderBufSize (incomingLoop,endIncomingLoop) <- dispatchLoop conn dispatch dispatchControl windowUpdatesChan _initIncomingFlowControl dispatchHPACK
src/Network/HTTP2/Client/FrameConnection.hs view
@@ -6,6 +6,7 @@ module Network.HTTP2.Client.FrameConnection ( Http2FrameConnection(..) , newHttp2FrameConnection+ , frameHttp2RawConnection -- * Interact at the Frame level. , Http2ServerStream(..) , Http2FrameClientStream(..)@@ -79,14 +80,14 @@ frameHttp2RawConnection http2conn = do -- Prepare a local mutex, this mutex should never escape the -- function's scope. Else it might lead to bugs (e.g.,- -- https://ro-che.info/articles/2014-07-30-bracket ) - writerMutex <- newMVar () + -- https://ro-che.info/articles/2014-07-30-bracket )+ writerMutex <- newMVar () let writeProtect io = bracket (takeMVar writerMutex) (putMVar writerMutex) (const io) -- Define handlers.- let makeClientStream streamID = + let makeClientStream streamID = let putFrame modifyFF frame = let info = encodeInfo modifyFF streamID in HTTP2.encodeFrame info frame
src/Network/HTTP2/Client/RawConnection.hs view
@@ -5,6 +5,7 @@ module Network.HTTP2.Client.RawConnection ( RawHttp2Connection (..) , newRawHttp2Connection+ , newRawHttp2ConnectionUnix , newRawHttp2ConnectionSocket ) where @@ -54,6 +55,22 @@ skt <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr) setSocketOption skt NoDelay 1 connect skt (addrAddress addr)+ pure skt+ newRawHttp2ConnectionSocket rSkt mparams++-- | Initiates a RawHttp2Connection with a unix domain socket.+--+-- The current code does not handle closing the connexion, yikes.+newRawHttp2ConnectionUnix :: String+ -- ^ Path to the socket.+ -> Maybe TLS.ClientParams+ -- ^ TLS parameters. The 'TLS.onSuggestALPN' hook is+ -- overwritten to always return ["h2", "h2-17"].+ -> ClientIO RawHttp2Connection+newRawHttp2ConnectionUnix path mparams = do+ rSkt <- lift $ do+ skt <- socket AF_UNIX Stream 0+ connect skt $ SockAddrUnix path pure skt newRawHttp2ConnectionSocket rSkt mparams