packages feed

warp-tls 3.3.3 → 3.3.4

raw patch · 3 files changed

+19/−12 lines, 3 filesdep ~warpPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: warp

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,12 @@ # ChangeLog +## 3.3.4++* Integrated customizable `accept` hook from `Network.Wai.Handler.Warp.Settings` (cf. `setAccept`)+  [#912](https://github.com/yesodweb/wai/pull/912)+* Adjusted `httpOverTls` because of the factoring out of `Network.Wai.Handler.Warp.Recv` to its own package `recv` in the `warp` package.+  [#899](https://github.com/yesodweb/wai/pull/899)+ ## 3.3.3  * Creating a bigger buffer when the current one is too small to fit the Builder
Network/Wai/Handler/WarpTLS.hs view
@@ -53,7 +53,7 @@     ) where  import Control.Applicative ((<|>))-import UnliftIO.Exception (Exception, throwIO, bracket, finally, handle, fromException, try, IOException, onException, SomeException(..), handleJust)+import UnliftIO.Exception (Exception, throwIO, bracket, finally, handle, handleAny, fromException, try, IOException, onException, SomeException(..), handleJust) import qualified UnliftIO.Exception as E import Control.Monad (void, guard) import qualified Data.ByteString as S@@ -66,7 +66,6 @@ import Network.Socket (     SockAddr,     Socket,-    accept,     close, #if MIN_VERSION_network(3,1,1)     gracefulClose,@@ -277,12 +276,8 @@ ----------------------------------------------------------------  getter :: TLS.TLSParams params => TLSSettings -> Settings -> Socket -> params -> IO (IO (Connection, Transport), SockAddr)-getter tlsset set sock params = do-#if WINDOWS-    (s, sa) <- windowsThreadBlockHack $ accept sock-#else-    (s, sa) <- accept sock-#endif+getter tlsset set@Settings{settingsAccept = accept'} sock params = do+    (s, sa) <- accept' sock     setSocketCloseOnExec s     return (mkConn tlsset set s params, sa) @@ -298,13 +293,14 @@  httpOverTls :: TLS.TLSParams params => TLSSettings -> Settings -> Socket -> S.ByteString -> params -> IO (Connection, Transport) httpOverTls TLSSettings{..} _set s bs0 params = do-    recvN <- makePlainReceiveN s bs0+    rawRecvN <- makePlainReceiveN s 2048 16384 bs0+    let recvN = wrappedRecvN rawRecvN     ctx <- TLS.contextNew (backend recvN) params     TLS.contextHookSetLogging ctx tlsLogging     TLS.handshake ctx     h2 <- (== Just "h2") <$> TLS.getNegotiatedProtocol ctx     isH2 <- I.newIORef h2-    writeBuffer <- createWriteBuffer bufferSize+    writeBuffer <- createWriteBuffer 16384     writeBufferRef <- I.newIORef writeBuffer     -- Creating a cache for leftover input data.     ref <- I.newIORef ""@@ -383,6 +379,10 @@             (ret, leftover) <- fill cached buf siz recv'             I.writeIORef cref leftover             return ret++    wrappedRecvN recvN n = handleAny handler $ recvN n+    handler :: SomeException -> IO S.ByteString+    handler _ = return ""  fill :: S.ByteString -> Buffer -> BufSize -> Recv -> IO (Bool,S.ByteString) fill bs0 buf0 siz0 recv
warp-tls.cabal view
@@ -1,5 +1,5 @@ Name:                warp-tls-Version:             3.3.3+Version:             3.3.4 Synopsis:            HTTP over TLS support for Warp via the TLS package License:             MIT License-file:        LICENSE@@ -21,7 +21,7 @@   Build-Depends:     base                          >= 4.12     && < 5                    , bytestring                    >= 0.9                    , wai                           >= 3.2      && < 3.3-                   , warp                          >= 3.3.22   && < 3.4+                   , warp                          >= 3.3.23   && < 3.4                    , data-default-class            >= 0.0.1                    , tls                           >= 1.5.3                    , cryptonite                    >= 0.12