| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
| |
And test cases for it, and its errors.
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
| |
Here is where my motivation is and I'm working on this code now, so do
this renaming cleanup now.
|
| |
|
|
|
|
|
|
|
| |
If we have a bridge guard that is using Direct connection and it
knows multiple addresses, our code to match it with a BridgeConfig
is wrong, because the BridgeConfig has only one address, and our
code looks for an exact match.
Fixes #642.
|
| |
|
|
|
| |
There are some new TODOs here for us to think about, but I think
this will give us something to test.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
Also, add a bunch of reminders around these implementations that
`HasAddrs` returns all the address associated with you for GeoIp or
family purposes, even if they are _not_ ones that we should actually
contact you at.
|
| | |
|
| |
|
|
|
| |
The BridgeSet type does not necessarily need further changes... and
if it gets them, it won't be because of this comment.
|
| |\
| |
| |
| |
| |
| |
| | |
Persistently cache bridge descriptors
Closes #619
See merge request tpo/core/arti!831
|
| | |
| |
| |
| |
| |
| | |
This is more consistent with our naming elsewhere.
Suggested-by: Nick Mathewson <[email protected]>
|
| | |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
This will match our needs better and help avoid some `Arc<>`s.
It will be especially helpful for avoiding `Arc`s we don't
actually have.
|
| | |
| |
| |
| | |
We require these for NetDirProvider, so this shouldn't be a big reach.
|
| |/
|
|
|
| |
This allows the use of Box<dyn BridgeDescProvider> in callers,
since Box<dyn BridgeDescProvider> is now Clone.
|
| |
|
|
| |
This removes some duplication.
|
| |
|
|
|
|
|
| |
Previously we always set `dir_info_missing` to `false` for new
guards, since new guards could only be taken from ones that were
present in the NetDir. But for bridges, we don't download their
info until _after_ we have chosen them as guards.
|
| |
|
|
|
| |
Now we can use a group of bridges as the basis for a sample of
guards.
|
| |
|
|
| |
This will enable us to impl FlagEvent for it.
|
| |
|
|
|
| |
The bridge descriptor manager wants to index data structures by the
BridgeConfig.
|
| |
|
|
| |
And explain what this all means.
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Use BridgeConfig to identify bridges in two places
See merge request tpo/core/arti!781
|
| | |
| |
| |
| |
| |
| |
| | |
Now keyed by Arc<BridgeConfig>, and the values can be errors.
Currently there is no implementation so there can't be any errors,
but the error enum will become nonempty.
|
| |/ |
|
| |
|
|
| |
Fixes #599
|
| | |
|
| |
|
|
|
|
|
| |
This lint exists for perf reasons, and this is rarely relevant in
tests.
Using double quoted str is generally cognitively less burdensome.
|
| |
|
|
|
|
|
| |
Now each `ChanTarget` has at most one `ChannelMethod`, and only
`Direct` `ChannelMethods` can have multiple addresses.
Closes #600.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HasAddr used to mean "Here are addresses that I have, at which I can
be contacted." But "Where (and how) can I be contacted?" is now a
question for HasChannelMethod to answer.
(We still need to have "HasAddr", though, so we can answer things
like "what country is this relay in" and "are these relays in the
same /8?")
So this commit introduces:
* A new trait for adding an implementation of HasChannelMethod in
terms of HasAddr.
* A requirement on ChanTarget that it needs to implement
HasChannelMethod.
There is some temporary breakage here, marked with "TODO pt-client",
that I'll fix later in this branch.
|
| | |
|
| |
|
|
| |
See comment for an explanation of the next issue here.
|
| |
|
|
|
|
| |
Also add a BridgeRelayWithDesc type (name tbd) to guarantee that
a bridge relay really does have a known descriptor before you
try to build a circuit with it.
|
| |
|
|
|
|
|
|
| |
This is the one we'll actually use to connect to bridges. It
has a `Bridge` line, and an optional `BridgeDesc`.
Maybe this will turn into a `BridgeRelay<'a>` by analogy to `Relay`
some time; I'm not sure.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
BridgeDesc is a separate type to make sure that we do not confuse
bridges' descriptors with the descriptors from other routers down
the road. (Bridges' descriptors need to be used differently, and
treated as more private.)
With this code, BridgerDescList is now just an alias for
`ByRelayIds<BridgeDesc>`, which is pretty keen.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Include the offending word in all the applicable errors.
Always print it with {word:?}.
As a consequence, there are no From impls any more and error
generation/conversion is by hand in all cases.
Clarify InvalidPtOrAddr vs InvalidIAddrorPt, and don't make the
attempted parse be a source error for those.
Where we still have source errors, don't print them in Display.
|
| |
|
|
|
| |
This is not perfect but it at least ensures that our own parsing and
printing code works correctly with all the values we accept.
|
| |
|
|
|
|
| |
It has its own error type PtTargetInvalidSetting.
In check_doc_features, adjust suppression to new code.
|
| | |
|
| | |
|