Do some small refactors in `tor-proto`
Some of the code in tor-proto
could probably do with cleaning up a bit / refactoring. Eventually I'd rather like to redesign how the reactors work somewhat considerably (also see #205 (closed)), but that's also going to require thinking about how to incorporate fairness.
For now, there are probably some small quick wins that can be had — copy-and-pasting from my notes from reading through the code yesterday, and I'll probably add to this:
- why make oneshot channels when you can just have an unbounded channel, for which sends never block?
- why does the RawCellStream have a Mutex of an mpsc::Receiver?
- it could either be an MPMC channel (as provided by crossbeam), or it could just not be shared
- should some of the information in StreamTarget be handled inside the reactor?
- doing this probably means the sendme windows don't need to have locks inside them, either
Edited by eta