warp 3.4.9 → 3.4.10
raw patch · 8 files changed
+33/−32 lines, 8 filesdep ~http2dep ~time-manager
Dependency ranges changed: http2, time-manager
Files
- ChangeLog.md +4/−0
- Network/Wai/Handler/Warp/HTTP2.hs +21/−23
- Network/Wai/Handler/Warp/Internal.hs +0/−1
- Network/Wai/Handler/Warp/RequestHeader.hs +1/−1
- test/RequestSpec.hs +1/−1
- test/RunSpec.hs +2/−2
- test/SendFileSpec.hs +1/−1
- warp.cabal +3/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for warp +## 3.4.10++* Using newest dependencies+ ## 3.4.9 * New flag `include-warp-version` can be disabled to remove dependency on `Paths_warp`.
Network/Wai/Handler/Warp/HTTP2.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -55,17 +54,16 @@ let recvN = wrappedRecvN th (S.settingsSlowlorisSize settings) rawRecvN sendBS x = connSendAll conn x >> T.tickle th conf =- H2.Config- { confWriteBuffer = bufBuffer writeBuffer- , confBufferSize = bufSize writeBuffer- , confSendAll = sendBS- , confReadN = recvN- , confPositionReadMaker = pReadMaker ii- , confTimeoutManager = timeoutManager ii-#if MIN_VERSION_http2(4,2,0)- , confMySockAddr = connMySockAddr conn- , confPeerSockAddr = peersa-#endif+ H2.defaultConfig+ { H2.confWriteBuffer = bufBuffer writeBuffer+ , H2.confBufferSize = bufSize writeBuffer+ , H2.confSendAll = sendBS+ , H2.confReadN = recvN+ , H2.confPositionReadMaker = pReadMaker ii+ , H2.confTimeoutManager = timeoutManager ii+ , H2.confMySockAddr = connMySockAddr conn+ , H2.confPeerSockAddr = peersa+ , H2.confReadNTimeout = True } checkTLS setConnHTTP2 conn True@@ -106,15 +104,15 @@ logResponse req st msiz mapM_ (logPushPromise req) pps Left e- | isAsyncException e -> E.throwIO e- | otherwise -> do- S.settingsOnException settings (Just req) e- let ersp = S.settingsOnExceptionResponse settings e- st = responseStatus ersp- (h2rsp', _, _) <- fromResponse settings ii req ersp- let msiz = fromIntegral <$> H2.responseBodySize h2rsp'- _ <- response h2rsp' []- logResponse req st msiz+ | isAsyncException e -> E.throwIO e+ | otherwise -> do+ S.settingsOnException settings (Just req) e+ let ersp = S.settingsOnExceptionResponse settings e+ st = responseStatus ersp+ (h2rsp', _, _) <- fromResponse settings ii req ersp+ let msiz = fromIntegral <$> H2.responseBodySize h2rsp'+ _ <- response h2rsp' []+ logResponse req st msiz return () where toWAIRequest h2req aux = toRequest ii settings addr hdr bdylen bdy th transport@@ -144,8 +142,8 @@ -- we should allow only few connections per host (real-world -- deployments with large NATs may be trickier). when- (BS.length bs > 0 && BS.length bs >= slowlorisSize || bufsize <= slowlorisSize) $- T.tickle th+ (BS.length bs > 0 && BS.length bs >= slowlorisSize || bufsize <= slowlorisSize)+ $ T.tickle th return bs where handler :: E.SomeException -> IO ByteString
Network/Wai/Handler/Warp/Internal.hs view
@@ -107,4 +107,3 @@ import Network.Wai.Handler.Warp.Settings import Network.Wai.Handler.Warp.Types import Network.Wai.Handler.Warp.Windows-
Network/Wai/Handler/Warp/RequestHeader.hs view
@@ -4,6 +4,7 @@ parseHeaderLines, ) where +import Control.Exception (throwIO) import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as C8 (unpack) import Data.ByteString.Internal (memchr)@@ -13,7 +14,6 @@ import Foreign.Ptr (Ptr, minusPtr, nullPtr, plusPtr) import Foreign.Storable (peek) import qualified Network.HTTP.Types as H-import Control.Exception (throwIO) import Network.Wai.Handler.Warp.Imports import Network.Wai.Handler.Warp.Types
test/RequestSpec.hs view
@@ -103,7 +103,7 @@ let testLengthHeaders = ["Sta", "tus: 200\r", "\n", "Content-Type: ", "text/plain\r\n\r\n"] headerLength = getSum $ foldMap (Sum . S.length) testLengthHeaders testLength = headerLength - 2 -- Because the second CRLF at the end isn't counted- -- Length is 39, this shouldn't fail+ -- Length is 39, this shouldn't fail it "doesn't throw on correct length" $ do src <- mkSourceFunc testLengthHeaders >>= mkSource x <- headerLines testLength FirstRequest src
test/RunSpec.hs view
@@ -6,6 +6,8 @@ import Control.Concurrent (forkIO, killThread, threadDelay) import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar) import Control.Concurrent.STM+import Control.Exception (IOException, bracket, onException, try)+import qualified Control.Exception as E import Control.Monad (forM_, replicateM_, unless) import Control.Monad.IO.Class (MonadIO, liftIO) import Data.ByteString (ByteString)@@ -23,8 +25,6 @@ import System.IO.Unsafe (unsafePerformIO) import System.Timeout (timeout) import Test.Hspec-import Control.Exception (IOException, bracket, onException, try)-import qualified Control.Exception as E import HTTP
test/SendFileSpec.hs view
@@ -2,6 +2,7 @@ module SendFileSpec where +import Control.Exception import Control.Monad (when) import Data.ByteString (ByteString) import qualified Data.ByteString as BS@@ -13,7 +14,6 @@ import qualified System.IO as IO import System.Process (system) import Test.Hspec-import Control.Exception main :: IO () main = hspec spec
warp.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: warp-version: 3.4.9+version: 3.4.10 license: MIT license-file: LICENSE maintainer: michael@snoyman.com@@ -107,7 +107,7 @@ hashable, http-date, http-types >=0.12,- http2 >=5.1 && <5.4,+ http2 >=5.4 && <5.5, iproute >=1.3.1, recv >=0.1.0 && <0.2.0, simple-sendfile >=0.2.7 && <0.3,@@ -246,7 +246,7 @@ http-client, http-date, http-types >=0.12,- http2 >=5.1 && <5.4,+ http2 >=5.4 && <5.5, iproute >=1.3.1, network, process,