Skip to content

tor-proto: Handle incoming XON/XOFF messages

This adds handling of incoming XON/XOFF messages, and updates the rate limit of the DataWriter accordingly.

/cc @gabi-250 since this makes some small changes to the tunnel/reactor

For context, XON messages are stream messages that contain a rate advertisement. If a relay sends us an XON containing a rate of 1 Mbit/s, we need to limit the rate that we send on that stream to 1 Mbit/s. If a relay sends us an XOFF, we must stop sending data on that stream.

We already have a rate limiter in DataWriter, so this MR adds the ability to receive these XON/XOFF messages and update the rate limit of the DataWriter. This requires a channel to communicate these rate limit updates from the reactor to the DataWriter.

Edited by opara

Merge request reports

Loading