Skip to content

tor-proto: Refactor some flow control code

As more code is being added for XON/XOFF flow control, it becomes a bit of a mess having it all in one enum. This refactor separates the window-based and XON/XOFF flow control implementations. It also moves flow control related code into a single "flow_ctrl" module.

This is all crate-internal code.

There's a lot of code being moved around but I tried to make the individual commits small, so reviewing each commit would be easiest.

Old file structure (ignoring unrelated files):

crates/tor-proto/src/client/stream/
├── flow_control.rs
└── xon_xoff.rs

New file structure (ignoring unrelated files):

crates/tor-proto/src/client/stream/
├── flow_ctrl
│   ├── state.rs
│   ├── window
│   │   └── state.rs
│   ├── window.rs
│   ├── xon_xoff
│   │   ├── reader.rs
│   │   └── state.rs
│   └── xon_xoff.rs
└── flow_ctrl.rs
Edited by opara

Merge request reports

Loading