@@ -84,16 +84,23 @@ data Leftover = LZero
8484
8585----------------------------------------------------------------
8686
87+-- | The context for HTTP/2 connection.
8788data Context = Context {
8889 http2settings :: IORef Settings
8990 , streamTable :: StreamTable
9091 , concurrency :: IORef Int
92+ -- | RFC 7540 says "Other frames (from any stream) MUST NOT
93+ -- occur between the HEADERS frame and any CONTINUATION
94+ -- frames that might follow". This field is used to implement
95+ -- this requirement.
9196 , continued :: IORef (Maybe StreamId)
9297 , currentStreamId :: IORef StreamId
9398 , inputQ :: TQueue Input
9499 , outputQ :: PriorityTree Output
95100 , encodeDynamicTable :: IORef DynamicTable
96101 , decodeDynamicTable :: IORef DynamicTable
102+ -- | This is used to synchronization of sender and receiver
103+ -- when the HTTP/2 connection is terminated.
97104 , wait :: MVar ()
98105 , connectionWindow :: TVar WindowSize
99106 }