on master help sign in
fixing thread killed on HTTP/2. (#692, #785)
85a788cKazu Yamamoto
warp/Network/Wai/Handler/Warp/HTTP2.hs+3−3
@@ -24,14 +24,14 @@ import Network.Wai.Handler.Warp.Types
24
24
25----------------------------------------------------------------
25----------------------------------------------------------------
26
26
27−http2 :: Connection -> Transport -> InternalInfo -> SockAddr -> S.Settings -> (BufSize -> IO ByteString) -> Application -> IO ()
27+http2 :: Connection -> Transport -> InternalInfo -> SockAddr -> S.Settings -> (BufSize -> IO ByteString) -> (ByteString -> IO ()) -> Application -> IO ()
28−http2 conn transport ii addr settings readN app =
28+http2 conn transport ii addr settings readN send app =
29 H2.run conf http2server
29 H2.run conf http2server
30 where
30 where
31 conf = H2.Config {
31 conf = H2.Config {
32 confWriteBuffer = connWriteBuffer conn
32 confWriteBuffer = connWriteBuffer conn
33 , confBufferSize = connBufferSize conn
33 , confBufferSize = connBufferSize conn
34− , confSendAll = connSendAll conn
34+ , confSendAll = send
35 , confReadN = readN
35 , confReadN = readN
36 , confPositionReadMaker = pReadMaker ii
36 , confPositionReadMaker = pReadMaker ii
37 }
37 }
warp/Network/Wai/Handler/Warp/Run.hs+2−1
@@ -351,10 +351,11 @@ serveConnection conn ii th origAddr transport settings app = do
351 if settingsHTTP2Enabled settings && h2 then do
351 if settingsHTTP2Enabled settings && h2 then do
352 rawRecvN <- makeReceiveN bs (connRecv conn) (connRecvBuf conn)
352 rawRecvN <- makeReceiveN bs (connRecv conn) (connRecvBuf conn)
353 let recvN = wrappedRecvN th istatus (settingsSlowlorisSize settings) rawRecvN
353 let recvN = wrappedRecvN th istatus (settingsSlowlorisSize settings) rawRecvN
354+ sendBS x = connSendAll conn x >> T.tickle th
354 -- fixme: origAddr
355 -- fixme: origAddr
355 checkTLS
356 checkTLS
356 setConnHTTP2 conn True
357 setConnHTTP2 conn True
357− http2 conn transport ii origAddr settings recvN app
358+ http2 conn transport ii origAddr settings recvN sendBS app
358 else do
359 else do
359 src <- mkSource (wrappedRecv conn th istatus (settingsSlowlorisSize settings))
360 src <- mkSource (wrappedRecv conn th istatus (settingsSlowlorisSize settings))
360 writeIORef istatus True
361 writeIORef istatus True