Skip to content

Commit

Permalink
Merge pull request #947 from Vlix/last-update-for-warp-3.3.30
Browse files Browse the repository at this point in the history
Last update for warp 3.3.30
  • Loading branch information
kazu-yamamoto authored Oct 17, 2023
2 parents fa4bb2a + c1c43ae commit db5c7a5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 7 additions & 1 deletion warp/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

## 3.3.30

* Fixed adding superfluous `Server` header if response already has it.
* Length of `ResponseBuilder` responses will now also be passed to the logger.
[#946](https://github.com/yesodweb/wai/pull/946)
* Using `If-(None-)Match` headers simultaneously with `If-(Un)Modified-Since` headers now
follow the RFC 9110 standard. So `If-(Un)Modified-Since` headers will be correctly ignored
if their respective `-Match` counterpart is also present in the request headers.
[#945](https://github.com/yesodweb/wai/pull/945)
* Fixed adding superfluous `Server` header when using HTTP/2.0 if response already has it.
[#943](https://github.com/yesodweb/wai/pull/943)

## 3.3.29
Expand Down
6 changes: 2 additions & 4 deletions warp/Network/Wai/Handler/Warp/IO.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}

module Network.Wai.Handler.Warp.IO where

import Control.Exception (mask_)
Expand All @@ -10,7 +8,7 @@ import Network.Wai.Handler.Warp.Buffer
import Network.Wai.Handler.Warp.Imports
import Network.Wai.Handler.Warp.Types

toBufIOWith :: Int -> IORef WriteBuffer -> (ByteString -> IO ()) -> Builder -> IO Int
toBufIOWith :: Int -> IORef WriteBuffer -> (ByteString -> IO ()) -> Builder -> IO Integer
toBufIOWith maxRspBufSize writeBufferRef io builder = do
writeBuffer <- readIORef writeBufferRef
loop writeBuffer firstWriter 0
Expand All @@ -21,7 +19,7 @@ toBufIOWith maxRspBufSize writeBufferRef io builder = do
size = bufSize writeBuffer
(len, signal) <- writer buf size
bufferIO buf len io
let totalBytesSent = len + bytesSent
let totalBytesSent = toInteger len + bytesSent
case signal of
Done -> return totalBytesSent
More minSize next
Expand Down
2 changes: 1 addition & 1 deletion warp/Network/Wai/Handler/Warp/Response.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ sendRsp conn _ th ver s hs _ maxRspBufSize _ (RspBuilder body needsChunked) = do
| otherwise = header <> body
writeBufferRef = connWriteBuffer conn
len <- toBufIOWith maxRspBufSize writeBufferRef (\bs -> connSendAll conn bs >> T.tickle th) hdrBdy
return (Just s, Just $ fromIntegral len)
return (Just s, Just len)

----------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion warp/test/RunSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Network.HTTP.Types
import Network.Socket
import Network.Socket.ByteString (sendAll)
import Network.Wai hiding (responseHeaders)
import Network.Wai.Internal (getRequestBodyChunk)
import Network.Wai.Handler.Warp
import System.IO.Unsafe (unsafePerformIO)
import System.Timeout (timeout)
Expand Down
2 changes: 1 addition & 1 deletion warp/warp.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Test-Suite spec
, text
, time-manager
, vault
, wai >= 3.2 && < 3.3
, wai >= 3.2.2.1 && < 3.3
, word8
, unliftio
if flag(x509)
Expand Down

0 comments on commit db5c7a5

Please sign in to comment.