summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool
Commit message (Collapse)AuthorAgeFilesLines
* tor-circmgr: Remove unnecessary Result wrapping.Gabriela Moldovan2024-03-201-3/+2
|
* tor-circmgr: Unconditionally define VanguardMode.Gabriela Moldovan2024-03-201-15/+5
|
* tor-circmgr: Add functions for checking if vanguards are enabled.Gabriela Moldovan2024-03-201-0/+16
|
* tor-circmgr: For each HS ClientCirc, note whether it's STUB or STUB+.Gabriela Moldovan2024-03-201-10/+7
| | | | Closes #1276
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Add HsCircPoolConfig, make HsCircPool::reconfigure general-purpose.Gabriela Moldovan2024-03-111-0/+25
|
* tor-circmgr: Rename Pool::reconfigure to Pool::reconfigure_vanguards.Gabriela Moldovan2024-03-111-1/+1
|
* tor-circmgr: Add functions for reconfiguring the HS circuit pool.Gabriela Moldovan2024-03-111-1/+24
| | | | | If the vanguard "mode" (full/lite/disabled) changes, we purge all the circuits from the HS circuit pool because they are no longer suitable.
* tor-circmgr: Store the VanguardMode in HsCircPool.Gabriela Moldovan2024-03-111-0/+11
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-111-0/+1
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
| |
* | rng ranges: Use gen_range_checked().expect() in obvious cases (fmt)Ian Jackson2023-07-101-1/+2
| |
* | rng ranges: Use gen_range_checked().expect() in obvious casesIan Jackson2023-07-101-1/+3
|/ | | | In each of these, it is locally obvious that the range is nonempty.
* random_idx_where: Ensure uniform distribution of choiceJim Newsome2023-06-231-22/+32
| | | | | Previously, this was more likely to select elements that occurred after other elements that didn't satisfy the predicate.
* Add more tests for random_idx_whereJim Newsome2023-06-231-0/+10
|
* tor-circmgr: Test random_idx_where with empty sliceIan Jackson2023-06-231-0/+7
| | | | | I have verified that this test fails, as expected, when applied without the corresponding bugfix.
* tor-circmgr: random_idx_where: Don't panic on empty rangeIan Jackson2023-06-231-0/+3
| | | | Fixes #918.
* Typo fixesgabi-2502023-06-201-2/+2
|
* circmgr: Use a slightly nicer way to pick a circuit from our pool.Nick Mathewson2023-06-161-13/+58
| | | | | | | | This algorithm only looks at circuits until it finds one that satisfies our needs. To get a random circuit, it just randomizes the starting point within the pool. This optimization may help if we let circuit pools grow large.
* circmgr: Make hspool size dynamicNick Mathewson2023-06-161-9/+98
| | | | | | | | | | | | | | Previously we'd always try to keep 8 circuits ready. That doesn't make sense if we are super-busy. Instead, if we run out of circuits, we double the amount that we try to keep ready, and if we never go under 80% of our target number, we half the number we try to keep ready. We limit the rate of change here, to make sure that we aren't flapping too much or shrinking too aggressively. This algorithm is still a mite arbitrary, and will need tuning in the future.
* circmgr::hspool: Move the Mutex into an intermediary Inner structNick Mathewson2023-06-161-11/+11
| | | | This will be helpful as we complexify the pool behavior a bit.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-6/+6
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* circmgr: Add an actual pool to HsCircPool.Nick Mathewson2023-03-221-0/+52
We now have support for a pool of pre-build circuits that we can use for HS-related purposes, and we take circuits from this pool as needed. Nothing populates or cleans the circuit pool yet.