on master help sign in
fixing thread killed on HTTP/2. (#692, #785)
commit85a788cf9e1f22b5a462edcb511ddd08ffbf072e authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 7 Jan 2020, 16:54 (7 years ago) parent3a27649
2 files changed+5−4
warp/Network/Wai/Handler/Warp/HTTP2.hs+3−3 warp/Network/Wai/Handler/Warp/Run.hs+2−1
warp/Network/Wai/Handler/Warp/HTTP2.hs+3−3
@@ -24,14 +24,14 @@ import Network.Wai.Handler.Warp.Types
2424
2525----------------------------------------------------------------
2626
27−http2 :: Connection -> Transport -> InternalInfo -> SockAddr -> S.Settings -> (BufSize -> IO ByteString) -> Application -> IO ()
28−http2 conn transport ii addr settings readN app =
27+http2 :: Connection -> Transport -> InternalInfo -> SockAddr -> S.Settings -> (BufSize -> IO ByteString) -> (ByteString -> IO ()) -> Application -> IO ()
28+http2 conn transport ii addr settings readN send app =
2929 H2.run conf http2server
3030 where
3131 conf = H2.Config {
3232 confWriteBuffer = connWriteBuffer conn
3333 , confBufferSize = connBufferSize conn
34− , confSendAll = connSendAll conn
34+ , confSendAll = send
3535 , confReadN = readN
3636 , confPositionReadMaker = pReadMaker ii
3737 }
warp/Network/Wai/Handler/Warp/Run.hs+2−1
@@ -351,10 +351,11 @@ serveConnection conn ii th origAddr transport settings app = do
351351 if settingsHTTP2Enabled settings && h2 then do
352352 rawRecvN <- makeReceiveN bs (connRecv conn) (connRecvBuf conn)
353353 let recvN = wrappedRecvN th istatus (settingsSlowlorisSize settings) rawRecvN
354+ sendBS x = connSendAll conn x >> T.tickle th
354355 -- fixme: origAddr
355356 checkTLS
356357 setConnHTTP2 conn True
357− http2 conn transport ii origAddr settings recvN app
358+ http2 conn transport ii origAddr settings recvN sendBS app
358359 else do
359360 src <- mkSource (wrappedRecv conn th istatus (settingsSlowlorisSize settings))
360361 writeIORef istatus True