@@ -18,6 +18,7 @@ import Data.IntMap.Strict (IntMap, IntMap)
18import qualified Data.IntMap.Strict as M
18import qualified Data.IntMap.Strict as M
19import qualified Network.HTTP.Types as H
19import qualified Network.HTTP.Types as H
20import Network.Wai (Request, Response)
20import Network.Wai (Request, Response)
21+import Network.Wai.HTTP2 (Trailers)
21import Network.Wai.Handler.Warp.IORef
22import Network.Wai.Handler.Warp.IORef
22import Network.Wai.Handler.Warp.Types
23import Network.Wai.Handler.Warp.Types
@@ -60,10 +61,18 @@ type BytesFilled = Int
60data Next = Next BytesFilled (Control DynaNext)
61data Next = Next BytesFilled (Control DynaNext)
62data Output = OFinish
63data Output = OFinish
64+ -- ^ Terminate the connection.
63 | OGoaway ByteString
65 | OGoaway ByteString
66+ -- ^ Send a goaway frame and terminate the connection.
64 | OFrame ByteString
67 | OFrame ByteString
68+ -- ^ Send an entire pre-encoded frame.
65 | OResponse Stream Response Aux
69 | OResponse Stream Response Aux
70+ -- ^ Send the headers and as much of the response as is immediately
66 | ONext Stream DynaNext
72 | ONext Stream DynaNext
73+ -- ^ Send a chunk of the response.
74+ | OTrailers Stream Trailers
75+ -- ^ Send a series of trailers in header and continuation frames.
68outputStream :: Output -> Stream
77outputStream :: Output -> Stream
69outputStream (OResponse strm _ _) = strm
78outputStream (OResponse strm _ _) = strm