| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We were using a hashtable to keep track of missing microdescriptor
digests. But this information is redundant with the NetDir state,
and there's now no longer any performance benefit to keeping a
separate copy.
Part of #386.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Absolish builders for CircMgrConfig and DirMgrConfig
See merge request tpo/core/arti!417
|
| | | | |
| | | |
| | | |
| | | | |
See rationale in the comment.
|
| |\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | | |
dirmgr: Always send if-modified-since on consensus documents.
Closes #403
See merge request tpo/core/arti!412
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We never want a consensus document that's super-old, since we would
reject it immediately for being too old.
Also, never send an if-modified-since that's so old that we'd reject
the response.
Closes #403
|
| | | |
| | |
| | |
| | | |
Instead, check initial_delay in dirmgr directly.
|
| | | |
| | |
| | |
| | | |
It wasn't necessary.
|
| | | |
| | |
| | |
| | |
| | | |
It's no longer about downloads; it's about whatever you need to
retry.
|
| | | |
| | |
| | |
| | |
| | | |
This (almost) a pure code-movement commit: it also makes one public
function private in order to suppress a warning.
|
| |/ /
| |
| |
| |
| | |
We'll need these for our unit tests in tor-dirmgr once we move
RetryDelay into tor-basic-utils.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
dirmgr: Call shrink_to_fit on missing-microdesc hashtable
Closes #388
See merge request tpo/core/arti!399
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This hashtable starts out pretty large, but it can spend most of our
runtime (when we aren't downloading) being small. To avoid doing
too much work, I've made it so we only call shrink_to_fit twice per
consensus: once when we're no longer pending, and once when we're
complete.
Closes #388.
|
| | | |
| | |
| | |
| | | |
Make update_config only conditionally exported; add semver-status update.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Add flatfile DirMgr
See merge request tpo/core/arti!318
|
| | |/ / |
|
| | | | |
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I used
git-grep -P '\#\[serde\((?!default|deny_unknown)'
to find places where I needed to add additional attributes on the
builder method fields.
This is currently a bit duplicative, but when #371 is completely done,
the validated (non-builder) configs won't need to be Deserialize any
more.
This is part of #371 and #372.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Errors for dirprovider
Closes #370
See merge request tpo/core/arti!385
|
| | | | |
|
| |\ \ \
| |/ /
|/| |
| | |
| | | |
Replace many manual trait impls with use of educe
See merge request tpo/core/arti!375
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Code motion and the minimal mechanical changes.
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
These aren't critical-path, but they do make the code a little nicer.
|
| |\ \ \
| |/ /
|/| |
| | |
| | | |
Alternative DirProvider setup
See merge request tpo/core/arti!347
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch removes the EventStream associated type and the Runtime
parameter. The Runtime parameter wasn't actually used for anything,
and the EventStream was easy enough to replace with a BoxStream in
this case.
Also replaced DirBootstrapEvents with a BoxStream to avoid tying
anything to our backend.
|
| | | | |
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This lint is IMO inherently ill-conceived.
I have looked for the reasons why this might be thought to be a good
idea and there were basically two (and they are sort of contradictory):
I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact
that only the pointer is being cloned, not the underlying data."
This is the wording from
https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr
It is a bit terse; we are left to infer why it is a bad idea to
obscure this fact. It seems to me that if it is bad to obscure some
fact, that must be because the fact is a hazard. But why would it be
a hazard to not copy the underlying data ?
In other languages, faliing to copy the underlying data is a serious
correctness hazard. There is a whose class of bugs where things were
not copied, and then mutated and/or reused in multiple places in ways
that were not what the programmer intended. In my experience, this is
a very common bug when writing Python and Javascript. I'm told it's
common in golang too.
But in Rust this bug is much much harder to write. The data inside an
Arc is immutable. To have this bug you'd have use interior mutability
- ie mess around with Mutex or RefCell. That provides a good barrier
to these kind of accidents.
II. "The reason for writing Rc::clone and Arc::clone [is] to make it
clear that only the pointer is being cloned, as opposed to the
underlying data. The former is always fast, while the latter can
be very expensive depending on what is being cloned."
This is the reasoning found here
https://github.com/rust-lang/rust-clippy/issues/2048
This is saying that *not* using Arc::clone is hazardous.
Specifically, that a deep clone is a performance hazard.
But for this argument, the lint is precisely backwards. It's linting
the "good" case and asking for it to be written in a more explicit
way; while the supposedly bad case can be written conveniently.
Also, many objects (in our codebase, and in all the libraries we use)
that are Clone are in fact simply handles. They contain Arc(s) (or
similar) and are cheap to clone. Indeed, that is the usual case.
It does not make sense to distinguish in the syntax we use to clone
such a handle, whether the handle is a transparent Arc, or an opaque
struct containing one or more other handles.
Forcing Arc::clone to be written as such makes for code churn when a
type is changed from Arc<Something> to Something: Clone, or vice
versa.
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Getting a non-200 status is no longer a failure condition; it's just
a different kind of answer.
Closes #349.
|
| |\ |
|
| | | |
|
| | |
| |
| |
| | |
So we get a stack trace
|
| | |
| |
| |
| |
| | |
We're about to reuse this and we'll want it to take the higher-level
type. Also it seems more proper like this.
|
| | |
| |
| |
| |
| | |
This isn't complete (see TODO), but it's enough to let us report the
right ErrorKind if something fails to parse.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
It had too many possible Kinds depending on what kind of string had
failed to parse.
I decided to use #[source] here instead of #[from], so that we
would have to explicitly convert these errors where they show up.
|
| | |
| |
| |
| |
| | |
At first I had thought that all sqlite errors would be internal, but that's
not the case.
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
The new `BootstrapBehavior` enum controls whether an unbootstrapped
`TorClient` will bootstrap itself automatically (`Ondemand`) when an
attempt is made to use it, or whether the user must perform
bootstrapping themselves (`Manual`).
The `lazy-init` example shows how you could write a simple
`get_tor_client()` function that used a global `OnceCell` to share
a Tor client across an entire application with this API.
closes arti#278
|
| |\
| |
| |
| |
| |
| |
| | |
Change deny(clippy::all) to warn(clippy::all).
Closes #338
See merge request tpo/core/arti!306
|
| | |
| |
| |
| | |
Closes #338.
|