@@ -251,26 +251,26 @@ sendRsp conn ver s hs (RspBuilder body needsChunked) = do
251251
252252----------------------------------------------------------------
253253
254−sendRsp conn ver s hs (RspStream withBodyFlush needsChunked th) = do
254+sendRsp conn ver s hs (RspStream streamingBody needsChunked th) = do
255255 header <- composeHeaderBuilder ver s hs needsChunked
256256 (recv, finish) <- newBlazeRecv $ reuseBufferStrategy
257257 $ toBlazeBuffer (connWriteBuffer conn) (connBufferSize conn)
258− let addChunk builder = do
258+ let send builder = do
259259 popper <- recv builder
260260 let loop = do
261261 bs <- popper
262262 unless (S.null bs) $ do
263− connSink conn th bs
263+ sendFragment conn th bs
264264 loop
265265 loop
266− addChunk'
267− | needsChunked = addChunk . chunkedTransferEncoding
268− | otherwise = addChunk
269− addChunk header
270− withBodyFlush addChunk' (addChunk' flush)
271− when needsChunked $ addChunk chunkedTransferTerminator
266+ sendChunk
267+ | needsChunked = send . chunkedTransferEncoding
268+ | otherwise = send
269+ send header
270+ streamingBody sendChunk (sendChunk flush)
271+ when needsChunked $ send chunkedTransferTerminator
272272 mbs <- finish
273− maybe (return ()) (connSink conn th) mbs
273+ maybe (return ()) (sendFragment conn th) mbs
274274
275275----------------------------------------------------------------
276276
@@ -296,8 +296,8 @@ sendResponseNoBody conn ver s hs = composeHeader ver s hs >>= connSendAll conn
296296----------------------------------------------------------------
297297
298298-- | Use 'connSendAll' to send this data while respecting timeout rules.
299−connSink :: Connection -> T.Handle -> ByteString -> IO ()
300−connSink Connection { connSendAll = send } th bs = do
299+sendFragment :: Connection -> T.Handle -> ByteString -> IO ()
300+sendFragment Connection { connSendAll = send } th bs = do
301301 T.resume th
302302 send bs
303303 T.pause th