@@ -22,6 +22,7 @@ import qualified Network.HTTP.Types as H
22import Network.HTTP2
22import Network.HTTP2
23import Network.HTTP2.Priority
23import Network.HTTP2.Priority
24import Network.Wai
24import Network.Wai
25+import Network.Wai.HTTP2 (Http2Application)
25import Network.Wai.Handler.Warp.HTTP2.EncodeFrame
26import Network.Wai.Handler.Warp.HTTP2.EncodeFrame
26import Network.Wai.Handler.Warp.HTTP2.Manager
27import Network.Wai.Handler.Warp.HTTP2.Manager
27import Network.Wai.Handler.Warp.HTTP2.Types
28import Network.Wai.Handler.Warp.HTTP2.Types
@@ -33,14 +34,14 @@ import Network.Wai.Internal (Response(..), ResponseReceived(..), ResponseReceive
34----------------------------------------------------------------
35----------------------------------------------------------------
36−-- | The wai definition is 'type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived'.
37+-- | The wai definition is @type Http2Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived@.
37−-- This type implements the second argument (Response -> IO ResponseReceived)
38+-- This type implements the second argument @Response -> IO ResponseReceived@
38-- with extra arguments.
39-- with extra arguments.
39type Responder = ThreadContinue -> T.Handle -> Stream -> Request ->
40type Responder = ThreadContinue -> T.Handle -> Stream -> Request ->
40 Response -> IO ResponseReceived
41 Response -> IO ResponseReceived
42-- | This function is passed to workers.
43-- | This function is passed to workers.
43−-- They also pass 'Response's from 'Application's to this function.
44+-- They also pass 'Response's from 'Http2Application's to this function.
44-- This function enqueues commands for the HTTP/2 sender.
45-- This function enqueues commands for the HTTP/2 sender.
45response :: Context -> Manager -> Responder
46response :: Context -> Manager -> Responder
46response Context{outputQ} mgr tconf th strm req rsp = do
47response Context{outputQ} mgr tconf th strm req rsp = do
@@ -83,7 +84,8 @@ data Break = Break deriving (Show, Typeable)
84instance Exception Break
85instance Exception Break
86−worker :: Context -> S.Settings -> T.Manager -> Application -> Responder -> IO ()
88+ Context -> S.Settings -> T.Manager -> Http2Application -> Responder -> IO ()
87worker ctx@Context{inputQ,outputQ} set tm app responder = do
89worker ctx@Context{inputQ,outputQ} set tm app responder = do
88 tid <- myThreadId
90 tid <- myThreadId
89 sinfo <- newStreamInfo
91 sinfo <- newStreamInfo