| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
|
| |
This warning kind of snuck up on us! (See #748) For now, let's
disable it. (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)
Closes #748.
|
| |\
| |
| |
| |
| | |
Add test lint blocks to all "mod test"
See merge request tpo/core/arti!937
|
| | |
| |
| |
| |
| | |
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
|
| |/
|
|
| |
Closes #589
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Require state ownership when using bridges
Closes #612
See merge request tpo/core/arti!889
|
| | |
| |
| |
| | |
Left unsquashed for ease of review
|
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
|
| | |
| |
| |
| | |
Fixes #612
|
| | |
| |
| |
| |
| |
| | |
The error type needs to be convertible to GuardMgrError and also to
ReconfigureError. Neither of those is right, so we need a new error
type.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`let _ignore =` isn't great because if the function called is
currently infallible, but becomes fallible, it suppresses the
detection of the error check.
A better pattern is to specify the type of the ignored value.
I'm about to do precisely this, here.
I did a git-grep and `let _ignore =` seems very common. Let's not
deal with all those now.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Make BridgeConfig be Arc, so no Arc<BridgeConfig>
Closes #635
See merge request tpo/core/arti!885
|
| | | |
| | |
| | |
| | | |
BridgeConfig is itself an Arc now, so these are redundant.
|
| |\ \ \
| |_|/
|/| |
| | |
| | | |
tor-guardmgr: Fix visibility of TestConfig with no features enabled
See merge request tpo/core/arti!875
|
| | | |
| | |
| | |
| | |
| | | |
Without this, tor-guardmgr tests don't build when run without the
crate's own testing feature enabled.
|
| | |/
|/|
| |
| | |
Closes #650.
|
| | |
| |
| |
| |
| | |
A bit more stuff is going to appear here, so it's getting to be rather
much for an inline module.
|
| |/
|
|
|
|
|
|
|
|
|
| |
This struct is going to be the principal "dictionary-style" serde
representation for a bridge, and the builder, making this all in
keeping with our usual approach.
In this commit:
* Introduce the struct (defining the serialisation)
* Provide the setters (defining the Rust API)
* Add success test cases (not all of the data in which is used yet)
|
| |
|
|
|
|
|
|
|
|
|
| |
This lets us avoid calling `Instant::now()`, when `Runtime::now()`
is what we want.
Unfortunately, there are a bunch of functions that called `update()`
that needed to change. Fortunately, none of the changes were very
complicated.
Fixes a `TODO pt-client` comment.
|
| |
|
|
|
|
|
| |
I'm about to add an `Instant` argument. By convention, when we have
both, we call the Instant "now".
This commit is a pure renaming.
|
| | |
|
| |\
| |
| |
| |
| | |
Bugfix: preserve active_set when loading guards
See merge request tpo/core/arti!848
|
| | | |
|
| |\|
| |
| |
| |
| |
| |
| | |
GuardMgr: Update desired bridge descs from 'update' function.
Closes #622
See merge request tpo/core/arti!847
|
| | |
| |
| |
| |
| | |
There are some new TODOs here for us to think about, but I think
this will give us something to test.
|
| |\ \
| |/
|/|
| |
| | |
Move guardmgr creation to arti-client, rather than within circmgr
See merge request tpo/core/arti!850
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
This is the only way I could find in which parameter interpretation
differs between bridge guards and relay guards; with it documented,
I can remove a TODO about identifying such ways.
|
| | |
| |
| |
| |
| | |
Have the check only apply to non-bridge universes, and explain why
in a bunch more comments.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously we would call extend_sample_as_needed in only two places,
one of which called the other unconditionally. That's obviously not
necessary.
I've selected just one of them (`update_guardset_internal`) since it
fits better with the theme if that function. I've added comments
explaining what is going on.
This commit also introduces a yes/no enum for "were any guards added
while extending this set". Formerly we had a boolean, but it got
passed around so many times that I think its intent became obscure.
|
| |/
|
|
|
|
|
|
|
|
|
| |
What this function actually does is return the number of primary
guards whose presence (by identity) is ambiguous in a current
universe. The new name and documentation should help avoid
confusion.
The method's old name had led me astray when identifying whether it
should apply to bridges in one case. This commit also removes the
corresponding `TODO pt-client`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This explanation is slightly complicated by the fact that I think
that one of the calls to update_guardset_internal() is possibly
unnecessary, and that one of the calls that it makes is potentially
ill-advised.
I'm not going to make those changes right now, however, because they
are potentially a little destabilizing.
|
| |
|
|
|
|
|
| |
Now it is an Option, and is set to None if bridges aren't enabled.
This simplifies `replace_bridge_config` a bit, and forces us to
check for `None` in a few more places.
|
| |
|
|
| |
Enforce this with assert!() and a documented panics section.
|
| | |
|
| |
|
|
|
| |
Also remove a bunch of now-unnecessary `allow(dead_code)`
annotations.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We do this by checking the FirstHops we're about to return, and when
they correspond to bridges, looking up an appropriate BridgeRelay
in the current BridgeSet (if we can).
|
| |
|
|
|
|
| |
We already _have_ these Arc<>s whenever we construct a UniverseRef,
so there's no real point in using &refs and making these so
hard to construct.
|
| |
|
|
| |
Found while grepping for NetDir.
|
| |
|
|
|
|
|
| |
The `GuardMgr` code has functionality to tell the DirMgr "Hey,
don't switch to the new NetDir yet: we still need more guard
information!" But we never want to do that if we're selecting
bridges, since they don't come from the NetDir.
|
| |
|
|
|
|
| |
Instead of duplicating the logic about which guard sample uses which
universe, we explicitly ask it, and then use that universe. This
will avoid trouble if/when we introduce more samples.
|
| |
|
|
| |
descriptors updated as appropriate.
|
| |
|
|
|
|
| |
This can probably be done in a simpler way, but for the moment I
would prefer to try to minimize the amount of code I'm changing
here.
|