| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This would have saved ahf and me a lot of confusion in debugging a
situation where we were cloning a reference of a type that didn't
implement Clone.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Rust 1.52 just came out, and there are new clippy lints to deal
with:
* It spots more cases when we could use Option::map
* It spots more cases when we could use Iterator::flatten
* When we build a struct instance, it wants us to list the fields
in the same order that the struct declares them.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Since these parts are testing-only, let's take steps to make sure we
don't ship them in production by accident.
|
| | |
|
| |
|
|
|
|
|
|
| |
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).
|
| | |
|
| |
|
|
| |
Closes #113
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This is a big change, but it is a step towards our goal of removing
tor_rtcompat:: calls directly.
|
| |
|
|
| |
This lets us simplify tor-dirclient a fair bit. Closes #79.
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously we read too much data from our input, and then used the
unused portion as an initial state of a buffer for handling
subsequent data. Yuck! Instead we can just use an AsyncBufRead and
only read the parts we want.
This code takes some pains to never read too much data: I'd rather
just "read until the first CRLF" or have some kind of pushback
mechanism. But for now it's probably fine.
|
| |
|
|
|
|
|
|
| |
The big idea of this revision is to separate the code that knows
about doing downloads from the code that decides what to download.
Later, we can make a similar change for database access. With these
changes together, we can make our code much more testable, and
eventually enable more download types in parallel.
|
| |
|
|
| |
This will help with my planned "directory state" refactoring.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This will let us use these types both as client and server-side
implementations.
Making this change required me to change the download code to take
requests by reference. (Sorry, David)
|
| | |
|
| |
|
|
|
| |
Rationale: the name of the request should match the name of the type
that you parse from it.
|
| |
|
|
|
|
| |
Having "no descriptors" mean "all of them" is kind of an accident
waiting to happen, and had wrong behavior for partial_docs_ok() and
max_response_len().
|
| | |
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
This is painful, but we shouldn't have to do it again.
|
| | |
|
| |
|
|
|
| |
This lets us reinstate the code in dirclient that retired circuits
depending on the error type.
|