@@ -181,7 +181,7 @@ sendResponse conn ii restore req reqidxhdr leftover' response = do
181181 ResponseFile _ _ path mPart -> RspFile path mPart mRange (T.tickle th)
182182 ResponseBuilder _ _ b -> RspBuilder b needsChunked
183183 ResponseSource _ _ fb -> RspSource fb needsChunked th
184− ResponseRaw raw _ -> RspRaw raw leftover'
184+ ResponseRaw raw _ -> RspRaw raw leftover' (T.tickle th)
185185 ret = case response of
186186 ResponseFile _ _ _ _ -> isPersist
187187 ResponseBuilder _ _ _ -> isKeepAlive
@@ -193,7 +193,7 @@ sendResponse conn ii restore req reqidxhdr leftover' response = do
193193data Rsp = RspFile FilePath (Maybe FilePart) (Maybe HeaderValue) (IO ())
194194 | RspBuilder Builder Bool
195195 | RspSource (forall b. WithSource IO (Flush Builder) b) Bool T.Handle
196− | RspRaw (forall b. WithRawApp b) (Maybe ByteString)
196+ | RspRaw (forall b. WithRawApp b) (Maybe ByteString) (IO ())
197197
198198----------------------------------------------------------------
199199
@@ -249,17 +249,19 @@ sendRsp conn ver s hs restore (RspSource withBodyFlush needsChunked th) =
249249
250250----------------------------------------------------------------
251251
252−sendRsp conn _ _ _ restore (RspRaw withApp mbs) =
252+sendRsp conn _ _ _ restore (RspRaw withApp mbs tickle) =
253253 withApp $ \app -> restore $ app src sink
254254 where
255− sink = CL.mapM_ (connSendAll conn)
255+ sink = CL.mapM_ (\bs -> connSendAll conn bs >> tickle)
256256 src = do
257257 maybe (return ()) yield mbs
258258 loop
259259 where
260260 loop = do
261261 bs <- liftIO $ connRecv conn
262− unless (S.null bs) $ yield bs >> loop
262+ unless (S.null bs) $ do
263+ liftIO tickle
264+ yield bs >> loop
263265
264266----------------------------------------------------------------
265267