summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Refactor our logic for distinguishing download attemptsNick Mathewson2022-06-133-85/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we used the "if-modified-since" time associated with the consensus download, and/or the "valid-after" time in the consensus attempt, to put multiple attempts into sequence, and to tell one from another. But that approach was always a kludge, and will soon get more unreliable as the DirStatus logic gets a bit more complex. With this commit, we change separate download attempts to be identified with an AttemptId that increments whenever we decide to get a different directory from the one we have. IMO this new code is _much_ cleaner.
| * | | Refactor most DirStatus users to use DirProgress.Nick Mathewson2022-06-134-71/+66
| | | | | | | | | | | | | | | | This is all crate-internal APIs, fortunately.
| * | | Move `at_least_as_new_as` to DirProgress.Nick Mathewson2022-06-131-4/+18
| | | |
| * | | Turn the DirProgress in DirStatus into a named field.Nick Mathewson2022-06-131-52/+73
| | | |
| * | | Rename DirStatusInner to DirProgress.Nick Mathewson2022-06-132-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | This is about to become only a _part_ of what defines a DirStatus: a DirStatus will also include a reset count, and some kind of info about how long we've gone without progress.
* | | | tor-chanmgr: Change to use unwrap_voidIan Jackson2022-06-212-8/+5
| | | | | | | | | | | | | | | | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813573
* | | | channel padding: Rename ChannelsParams from ChannelsConfig (rustfmt)Ian Jackson2022-06-212-2/+2
| | | | | | | | | | | | | | | | Consequential ordering changes.
* | | | channel padding: Rename ChannelsParams from ChannelsConfigIan Jackson2022-06-217-98/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276 Change names and comments and docs everywhere.
* | | | channel padding: chanmgr: Clarify a commentIan Jackson2022-06-211-3/+3
| | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813574
* | | | tor-proto: Have Channel::reconfigure throw ChannelClosedIan Jackson2022-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813567
* | | | tor-proto: err: Provide ChannelClosed as a separate unit errorIan Jackson2022-06-215-18/+38
| | | |
* | | | channel padding: Use IntegerMilliseconds in netdirIan Jackson2022-06-212-20/+18
| | | |
* | | | tor-netdir: Make CHANNEL_PADDING_TIMEOUT_UPPER_BOUND pubIan Jackson2022-06-211-1/+1
| | | | | | | | | | | | | | | | We need this because it is a type parameter for the types of nf_ito_*.
* | | | channel padding: Use IntegerMilliseconds in padding::ParametersIan Jackson2022-06-214-20/+28
| | | |
* | | | tor-units: IntegerTimeUnit: Provide try_mapIan Jackson2022-06-211-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets a caller map the inner value, eg to convert the type. I don't provide `map` as well as `try_map` now, since I don't need it; we could add it later if it is desirable (although try_map can always be used instead). I was hoping to provide a `TryFrom` instead, but that necesasrily overlaps with the std conversion impl from IntegerMilliseconds<T> to IntegerMilliseconds<U> where T == U.
* | | | tor-units: IntegerTimeUnit: Relax condition on TIan Jackson2022-06-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is semantically quite meaningful for these to contain something that isn't `TryInto<u64>`. (Of course the `Duration` conversion won't work without that.) Indeed, this condition was only applied to two out of the three types. Prompted by being near this code, but not actually necessary for anything I'm doing here.
* | | | tor-units: IntegerTimeUnit: Provide as_time_unit deconstructorIan Jackson2022-06-211-0/+24
| | | | | | | | | | | | | | | | We're going to need this to use this in the padding timer parameters.
* | | | channel padding parameters update: Drop a redundant cloneIan Jackson2022-06-211-1/+1
| | | |
* | | | channel padding: Change timeout to match C TorIan Jackson2022-06-211-1/+6
| | | | | | | | | | | | | | | | Pending an official value from the spec.
* | | | Fix docs for `CtrlMsg::ConfigUpdate`Ian Jackson2022-06-211-5/+2
| | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813565
* | | | Fix typoseta2022-06-212-3/+3
| | | |
* | | | channel padding: Test timeout updatesIan Jackson2022-06-212-1/+50
| | | |
* | | | tor-chanmgr tests: Add config_update tracking to FakeChannelIan Jackson2022-06-211-1/+7
| | | |
* | | | channel padding: Honour NetDir for timeoutsIan Jackson2022-06-211-3/+47
| | | | | | | | | | | | | | | | But padding is still not enabled by default.
* | | | channel padding: Add the parameters from the spec to NetDirIan Jackson2022-06-211-0/+28
| | | |
* | | | channel padding: Plumb settings from chanmgrIan Jackson2022-06-218-27/+191
| | | |
* | | | channel padding: Introduce ChannelsConfig and reconfigure facilityIan Jackson2022-06-214-3/+242
| | | | | | | | | | | | | | | | Nothing geenrates config updates yet.
* | | | chanmgr: inner (map): Reorganise to prepare for having more stateIan Jackson2022-06-211-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | The main copy of the (global) configuration for the client's channels is going to have to live here, inside this mutex. So this really needs to become a struct with names fields.
* | | | channel padding timer: Support reconfigurationIan Jackson2022-06-211-4/+15
| | | | | | | | | | | | | | | | Nothing calls this yet.
* | | | channel padding timer: Allow creation without providing parameters yetIan Jackson2022-06-212-16/+32
| | | | | | | | | | | | | | | | It turns out that we are going to want this.
* | | | channel padding: Test creation in disabled stateIan Jackson2022-06-211-0/+12
| | | | | | | | | | | | | | | | | | | | We're about to split the main new() function off so write a separate test for new_disabled().
* | | | channel padding: Make Parameters a pub struct with builderIan Jackson2022-06-213-3/+15
| | | | | | | | | | | | | | | | chanmgr is going to want to make one of these from a NetDir.
* | | | tor-chanmgr: tests: Have unwrap_open return a (mut) referenceIan Jackson2022-06-211-2/+2
| |/ / |/| | | | | | | | | | | This avoids confusing bugs where you try to modify the result and nothing happens!
* | | Updated the warning message providing additional information about the type ↵0x4ndy2022-06-211-2/+1
| | | | | | | | | | | | of the proxy port.
* | | Merge branch 'ring_out_the_old' into 'main'Ian Jackson2022-06-172-2/+4
|\ \ \ | | | | | | | | | | | | | | | | Enforce no-ring-in-arti/full (and make it true) See merge request tpo/core/arti!592
| * | | Remove rustls from tor-rtcompat/fullNick Mathewson2022-06-162-2/+4
| | | | | | | | | | | | | | | | This is another consequence of the `ring` license issue; see #493.
* | | | Merge branch 'reachable_addrs_v2' into 'main'Nick Mathewson2022-06-1714-150/+480
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement support for reachable_addrs Closes #491 and #93 See merge request tpo/core/arti!583
| * | | | Rename guardset-selection function.Nick Mathewson2022-06-171-2/+7
| | | | | | | | | | | | | | | | | | | | Also, improve its documentation.
| * | | | Rename pick_guard, pick_guard_ext.Nick Mathewson2022-06-172-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the primary exposed function is `pick_guard` again. This commit is just function renaming.
| * | | | Refactor and document issues with modify_hop.Nick Mathewson2022-06-173-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the site of modify_hop, we now have a comment explaining the internal-error issue. To make the internal error less likely, we lower the modify_hop call in lib.rs into GuardSet, where it can make sure it's looking at the same filter as was used to select the guard. The function name "pick_guard_ext" is not permanent; I'm going to rename it in the next commit.
| * | | | API-fix for extend_sample_as_needed.Nick Mathewson2022-06-172-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the API said "you need to call this in a loop till it returns false". We did that in one place, but not another. With the introduction of filters, forgetting to loop here becomes a bug: so instead, change the behavior of extend_sample_as_needed so it handles looping itself.
| * | | | Remove some outdated comments.Nick Mathewson2022-06-174-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | These all say, in one form or another, "there is no guard filtering; there is only one selection". That's now false.
| * | | | Tweak parameters in guardmgr tests to improve testnet behavior.Nick Mathewson2022-06-171-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake network we construct for these tests is small in ways that can sometimes cause weird behavior with guard filters. We fix this by adjusting the parameters of the guard selection algorithm accordingly in the tests. With these new parameters, #491 no longer occurs. This commit also adds comments to explain why the parameters are set as they are. Closes #491.
| * | | | CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-172-1/+21
| | | | |
| * | | | Add a configuration option for reachable_addrsNick Mathewson2022-06-173-0/+46
| | | | | | | | | | | | | | | | | | | | (This doesn't do anything yet.)
| * | | | NetDoc: Make AddrPortPattern implement serde traitsNick Mathewson2022-06-173-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm using serde_with here to just re-use the Display and FromStr implementations, since those are what has proven easier to type in the past.
| * | | | GuardMgr: Support for multiple guard setsNick Mathewson2022-06-172-33/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | guard-spec.txt specifies that we have multiple separate samples of guards that we can use depending on whether the filter is restrictive or not. Here we implement the rules for switching between samples.
| * | | | Move set_filter into GuardMgrInner.Nick Mathewson2022-06-173-41/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Convert its argument type to Option<&NetDir> to better match the rest of the API.
| * | | | GuardMgr: Function to tell how permissive a filter is.Nick Mathewson2022-06-171-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we're filtering guards, we have to check whether the filter is "restrictive": if it forbids most of the guards (by bandwidth), we keep its guards separated from the main set. If it is super-restrictive, we also warn. This functionality is specified in guard-spec.txt.
| * | | | Make AddrPortPattern and friends implement Eq and PartialEqNick Mathewson2022-06-172-2/+3
| | | | |