Skip to content

proto: Add the initial implementation of the relay reactor(s)

This sketches out the "dual" relay reactor implementation that @dgoulet helped me brainstorm, which has:

  • a ForwardReactor, which forwards cells from the client to the exit
  • a BackwardReactor, which deals with streams, control messages, and forwarding cells from the exit to the client

The BackwardReactor is actually the "primary" reactor. It's the interface we expose to the channel reactor (via the RelayReactor type-alias), and it is in charge of spawning the "secondary" ForwardReactor task (via its run() function).

See the module-level docs from tor_proto::relay::reactor for more details on the inner workings of the two reactors.

Most of the functions are implementation stubs for now. This MR also adds the incomplete skeleton of the circuit extension logic. Once #1599 is implemented, we'll be able to uncomment the commented code, or replace it, depending on what the corresponding channel reactor APIs look like.

Part of #1803 (closed) and #2212

cc @opara

Edited by gabi-250

Merge request reports

Loading