aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/congestion/test_utils.rs
Commit message (Collapse)AuthorAgeFilesLines
* proto: Remove unnecessary test-gatingGabriela Moldovan2026-03-191-4/+0
| | | | | The `test_util` modules is already gated behind `#[cfg(any(test, feature = "testing"))]`.
* proto: Pass owned CongestionWindowParams to CongestionControl::new.Gabriela Moldovan2025-09-041-1/+1
| | | | | | | We no longer need to clone `CongestionWindowParams` now that it implements `Copy`. Resolves a clippy warning.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-proto: Remove no-longer needed clone()s.Gabriela Moldovan2025-06-111-2/+2
| | | | | | This doesn't really change anything, but removing the `.clone()` makes it a bit more obvious that copying the `*Params` is a lightweight operation.
* proto: Refactor cc fallback.Nick Mathewson2025-06-101-2/+2
| | | | | The fallback CC algorithm is _always_ fixed-window, and we should only use it when the selected CC algorithm is not supported.
* tests: Add CC ntorv3 negotiation unit testDavid Goulet2025-04-231-5/+29
| | | | | | | | Also add one for the sendme_inc validity function. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* congestion: Setup a fallback algorithm in the paramsDavid Goulet2025-04-231-1/+2
| | | | | | | | | | | | | | | | CircParameters is built before path selection and thus once we start building the hops, we can't access the consensus values that were used to build it in the first place. For congestion control, we require a fallback algorithm in case the hop doesn't support FlowCtrl=2. This commit adds a "fallback_alg" to the CC parameters which will be used for this exact case. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* congestion: Remove Default from every parametersDavid Goulet2025-01-161-0/+2
| | | | | | | Important to enforce that every field is explicitely set so we avoid forgetting fields. Signed-off-by: David Goulet <[email protected]>
* congestion: Remove FixedWindow start window default valueDavid Goulet2025-01-161-1/+15
| | | | | | | | In unit tests, we set a 1000 by default but else, we don't set a default so our implementation doesn't forget to set the right value from the consensus. Signed-off-by: David Goulet <[email protected]>
* congestion: Make a test_utils.rsDavid Goulet2025-01-161-0/+52
Instead of having the congestion.rs test module public, make a test_utils.rs file that contains code for other unit tests within the congestion module. Signed-off-by: David Goulet <[email protected]>