Thomas Eizinger 53d445e61c
protocols/kademlia: Refactor stream state machines (#3074)
* Refactor `InboundSubstreamState` to implement `Stream`

This allows us to use `stream::SelectAll` instead of iterating
through the states ourselves. It also allows us to fix an existing
TODO where we don't properly close a stream.

* Refactor `OutboundSubstreamState` to implement `Stream`

* Remove unnecessary keep_alive changes

The same thing is happening further down.

* Remove code duplication in answering requests

* Debug assert that we can answer every request
2022-11-02 19:20:55 +00:00
..