By setting up the handler in the handlerAdded hook, HTTP2Parser supports
being added dynamically in a channelRead event, after the channel has sent
the channelActive event.
Motivation:
We shouldn't just crash if the client sends bad magic.
Changes:
Send an error through the pipeline instead of crashing on bad client
magic.
Result:
fewer crashes
Motivation:
Long-lived connections that have many inactive streams would cause
crashes. Crashes are, in my professional opinion, less than ideal
when they occur under expected usage cases.
Modifications:
- Fixed an inverted boolean check that would discard only *active*
streams.
- Made the cached stream count configurable, removing a TODO.
- Added tests.
Result:
Fewer crashes, better software.
Motivation:
Our tests were failing as a result of the previous commit changing the
HTTP/2 lifecycle.
Modifications:
Fired channelActive in a few tests, correctly propagated
channelInactive.
Result:
Tests should pass.
Motivation:
The example server had slowly bitrotted over time: some minor fixes were
needed.
Modifications:
I fixed it!
Result:
The example server works against a basic curl command.