summaryrefslogtreecommitdiff
path: root/tor-circmgr/src/impls.rs
Commit message (Collapse)AuthorAgeFilesLines
* More tests and a little code-golf for coverage on tor-circmgrNick Mathewson2021-06-201-4/+2
|
* tor_circmgr: simplify build_circuit a bit.Nick Mathewson2021-06-201-15/+4
|
* A little testing and refactgoring in tor-circmgr.Nick Mathewson2021-06-191-12/+0
|
* Enormous tor-circmgr rewrite.Nick Mathewson2021-06-141-0/+127
As with the tor-chanmgr code, the circuit manager is now implemented using an AbstractCircMgr type that uses traits to abstract the particular behavior of other types that it uses. (Specifically: circuits, building circuits, and telling whether one circuit usage is compatible with another.) Abstracting out the dependencies in this ways makes it possible to test the circuit manager without having to actually build real circuits. This commit also introduces new behavior for handling pending circuit requests. Upon getting a new request, first we check to see if there's an existing circuit we can use. If there isn't, we look for pending circuits and wait for them. If there aren't any pending circuits we can use, we launch one or more, and wait for them. So far, that's the same as the old behavior. But here's a change: if, while we are waiting for some pending circuits, a different circuit is completed, and it's one we could use, then the task that was building _that_ circuit will tell us: "please look at this circuit". This gives us better changes of getting a usable circuit fast. Minor changes: * The Error type in CircMgr no longer uses anyhow; several errors have been simplified. * We've gotten more formal about the relationship between circuit usage and target usage.