mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
Motivation: channelActive must always precede channelInactive. Unfortunately, this isn't guaranteed right now: if we happen to get channelInactive as a result of our writing the preamble we'll fire them in the wrong order. Many systems can tolerate this, but we should avoid doing this anyway. Modifications: - Added a state enum to keep track of the state we're in - Use that state enum to ensure we deliver active/inactive in the right order - Additionally police other unexpected active/inactive behaviours Result: We'll appropriately police the state.