summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/mgr.rs
Commit message (Collapse)AuthorAgeFilesLines
* circmgr: Fix a pair of clippy warnings.Nick Mathewson2022-01-071-2/+2
|
* tor-circmgr: Remove Arc around ClientCircIan Jackson2022-01-071-11/+11
| | | | | | See the new commentary text on `ClientCirc` for the rationale. Signed-off-by: Ian Jackson <[email protected]>
* tor-circmgr: tests: Do fake circuit equality by idIan Jackson2022-01-071-2/+2
| | | | | | | | | We are going to get rid of the Arc. Happily there is an id which is always constructed uniquely and preserved by clone. (auto-deref lets us make the function take &Self instead of &Arc) Signed-off-by: Ian Jackson <[email protected]>
* tor-circmgr: tests: Introduce and use FakeCirc::eq()Ian Jackson2022-01-071-13/+19
| | | | | | This removes a lot of open-coded Arc::ptr_eq() calls Signed-off-by: Ian Jackson <[email protected]>
* tor-circmgr: Replace some Arc::clone with .clone()Ian Jackson2022-01-071-5/+5
| | | | | | This will make the code work when it's not an Arc any more. Signed-off-by: Ian Jackson <[email protected]>
* tor-circmgr: Require that AbstractCirc are CloneIan Jackson2022-01-071-1/+1
| | | | | | | We are going to get rid of a lot of Arc, so we need the underlying thing to be Clone. Signed-off-by: Ian Jackson <[email protected]>
* Remove XXXs from tor-circmgr::mgrNick Mathewson2021-12-201-4/+0
| | | | | | IIUC, these anticipatd a need to store min_exit_circs_per_port in CircMgr. But the current design, where it goes into preemptive.rs and thence to usage, seems to work fine.
* Do not treat spawn failure as a fatal error.Nick Mathewson2021-12-151-12/+12
|
* Expand some comments about circuit expiration.Nick Mathewson2021-12-151-4/+9
| | | | | Emphasize that circuit expiration functions _decide whether to expire the circuit_, and don't expire it automatically.
* Add spawn_expiration_task function in circuit managerYuan Lyu2021-12-151-23/+103
|
* Make circuit_timing reconfigurable.Nick Mathewson2021-12-071-12/+18
|
* Allow on-the-fly changing of path_rulesNick Mathewson2021-12-071-7/+33
| | | | | | | | | | | | And now the complexity begins: when the user changes the path_rules, they not only want new circuits to obey those rules: they want _all new requests_ to be put onto circuits that obey those rules. That means that when the path rules become more restrictive, we need to retire all the circuits, and make sure that currently pending circuits aren't used for any requests. If it's any comfort, doing this was even more complicated in C tor. ;)
* Sketch API for reconfiguration.Nick Mathewson2021-12-071-0/+7
| | | | | | | This patch doesn't actually make anything reconfigurable, but it does create an API that will tell you "you can't change the value of that!" If the API looks reasonable, I can start making it possible to change the values of individual items.
* Allow configurability on preemptive circuitsNeel Chauhan2021-12-071-3/+11
|
* Merge remote-tracking branch 'origin/mr/154'Nick Mathewson2021-11-301-24/+195
|\
| * Add tests & address review commentaryeta2021-11-301-7/+155
| |
| * Introduce PreemptiveCircuitPredictor and TargetCircUsage::Preemptiveeta2021-11-231-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for making Arti build circuits preemptively, this commit introduces `TargetCircUsage::Preemptive`, a circuit usage that works somewhat differently from other ones: it requires at least 2 circuits to exist that can exit the port it contains in order for an existing circuit to match against it (path-spec.txt § 2.1.1); if that's not the case, that usage will require building new circuits (in order that we build enough to have 2 available). This required refactoring how circuit reuse worked; now, `CircList::find_open` uses the new `AbstractSpec::find_supported` trait method, which we customize to implement the above check in the case of `Preemptive` circuit usages. To make that work, `OpenEntry` now takes two type parameters (the spec and circuit types), instead of taking a builder type parameter and using its associated types. (We also got rid of type constraints on that struct, yay!) A WIP implementation of a preemptive circuit predictor that implements path-spec.txt § 2.1.1 is also included, but this will require additional effort to wire it up with the `CircMgr` properly.
* | Merge remote-tracking branch 'origin/mr/148'Nick Mathewson2021-11-291-10/+2
|\ \
| * | In struct PendingEntry, remove circ_specNeel Chauhan2021-11-281-10/+2
| |/
* | add semicolons if nothing returnedDaniel Eades2021-11-251-3/+3
| |
* | deglob some enums, use concise iteration syntaxDaniel Eades2021-11-251-1/+1
|/
* Fold "circuit_timing" and "request_timing" into a single section.Nick Mathewson2021-11-181-30/+7
|
* Replace all println/eprintln calls outside of arti CLI with trace.Nick Mathewson2021-11-041-1/+2
|
* Mark request_retried test as ignoredNick Mathewson2021-10-281-0/+1
|
* circmgr: Split request_timeout test into two.Nick Mathewson2021-10-261-0/+7
| | | | | | | There seems to be some issue here with the new WaitFor code, where using the same MockSleepProvider with both of these wait_for() calls gives questionable behavior under some circumstances (like when running under Tarpaulin with the wrong set of flags).
* Overhaul the way WaitFor and the MockSleepProvider worketa2021-10-261-7/+51
| | | | | | | | | | | | | | | | | | | | | Instead of racily advancing time forward, this commit attempts to rework how WaitFor works, such that it makes advances when all sleeper futures that have been created have been polled (by handing the MockSleepRuntime a Waker with which to wake up the WaitFor). The above described mechanics work well enough for the double timeout test, but fail in the presence of code that spawns asynchronous / background tasks that must make progress before time is advanced for the test to work properly. In order to deal with these cases, a set of APIs are introduced in order to block time from being advanced until some code has run, and a carveout added in order to permit small advances in time where required. (In some cases, code needed to be hacked up a bit in order to be made properly testable using these APIs; the `MockablePlan` trait included in here is somewhat unfortunate.) This should fix arti#149.
* Implement the "request_loyalty" configuration optionNick Mathewson2021-10-191-2/+1
|
* Do not use set_ prefix on derive_builder settersJani Monoses2021-09-161-1/+1
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* A little more test coverage in tor-circmgr::mgrNick Mathewson2021-09-071-5/+35
|
* tor_circmgr::mgr -- refactor some duplicate code.Nick Mathewson2021-09-071-20/+32
|
* Rename pick_action to clarify that it can modify selfNick Mathewson2021-09-071-5/+5
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+1692
This will cause some pain for now, but now is really the best time to do this kind of thing.