summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Implement HasKind for tor_dirclient::ErrorNick Mathewson2022-02-162-0/+25
| | |
| * | dirclient: remove an unused error type.Nick Mathewson2022-02-161-4/+0
| | |
| * | Clarify and rename PendingCanceledNick Mathewson2022-02-162-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | From its old name, this error had implied that we were giving no useful information when we were waiting on a pending cirucit request that failed. In fact, this error would only happen if we dropped the `mpsc::Sender` for a circuit attempt without reporting success or failure.
| * | Provide a better ErrorKind from RetryError.Nick Mathewson2022-02-161-3/+26
| | | | | | | | | | | | (Instead of reporting the _last_ error, report the _worst_ error.)
| * | circmgr: Add a Kind for speculative guard failure.Nick Mathewson2022-02-162-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These errors should almost never be seen by the user; we should instead retry the circuit. But they _can_ be seen by the use if selecting a guard takes too long, or too many attempts. (Therefore, they aren't true "internal" errors.) I suspect that we might not want to keep this TransientFailure kind, but I'm not sure what else to do here for now.
| * | Add kinds for *most* circmgr errors.Nick Mathewson2022-02-167-35/+104
| | | | | | | | | | | | There are a couple of tricky ones I'll do separately.
| * | circmgr: Port InternalError to use Bug.Nick Mathewson2022-02-163-6/+12
| | |
* | | Fix compilation on mainNick Mathewson2022-02-171-1/+2
| | |
* | | Merge branch 'clippy-followup' into 'main'Nick Mathewson2022-02-172-3/+4
|\ \ \ | | | | | | | | | | | | | | | | Remove some needless refs and slicing See merge request tpo/core/arti!327
| * | | Avoid recursive From implsIan Jackson2022-02-172-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These (&foo).into() constructions are needed so we use the implemnetation of `From<&Foo>`, not a recursive call to this very function. This is a partial revert of the previous commit. I'm making this a separate commit for the benefit of posterity.
| * | | Remove some needless refs and slicingIan Jackson2022-02-173-6/+6
| | | | | | | | | | | | | | | | | | | | Prompted by nightly's clippy (which has some false positives, so is currently disabled).
| * | | Add a comment about "&mut [&mut ]"Ian Jackson2022-02-171-0/+1
| | | |
* | | | Merge branch 'issue-325' into 'main'eta2022-02-172-26/+84
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Make CircMap open_ent_count O(1) See merge request tpo/core/arti!302
| * | | | Replace as_mut with deref impl for MutCircEntYuan Lyu2022-02-162-26/+34
| | | | |
| * | | | Make CircMap open_ent_count O(1)Yuan Lyu2022-02-162-26/+76
| | | | |
* | | | | Merge branch 'bootstrap_second' into 'main'Ian Jackson2022-02-171-4/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arti: create TorClient first, then bootstrap. Closes #336 See merge request tpo/core/arti!320
| * | | | | arti: create TorClient first, then bootstrap.Nick Mathewson2022-02-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is possible now that #293 is done. As an immediate benefit, it allows us to start monitoring the configuration files immediately, and not only after we're done bootstrapping the client. Closes #336.
* | | | | | Merge branch 'typos' into 'main'Ian Jackson2022-02-171-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix typos See merge request tpo/core/arti!326
| * | | | | | Fix typosDimitris Apostolou2022-02-171-3/+3
| | |/ / / / | |/| | | |
* | | | | | Merge branch 'ptr_arg_fix' into 'main'Ian Jackson2022-02-172-3/+2
|\ \ \ \ \ \ | |/ / / / / |/| | / / / | | |/ / / | |/| | | Re-enable clippy::ptr_arg where it had been disabled. See merge request tpo/core/arti!323
| * | | | Re-enable clippy::ptr_arg where it had been disabled.Nick Mathewson2022-02-162-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In one of the two places, nightly no longer warns. In the other place, it's fine for nightly to warn: I just fixed the code to take a slice instead. Partial revert of 856aca879151c622512bc4b15c6307808fc83e82. Resolves part of #310.
* | | | | Merge branch 'eta/lazy-init' into 'main'eta2022-02-165-16/+155
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | arti-client: add ability to automatically bootstrap Closes #278 See merge request tpo/core/arti!322
| * | | | arti-client: add ability to automatically bootstrapeta2022-02-165-16/+155
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge branch 'chanmgr-error' into 'main'Nick Mathewson2022-02-164-18/+30
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Implement HasKind for tor-chanmgr::Error See merge request tpo/core/arti!324
| * | | | tor-chanmgr: use Bug types.Nick Mathewson2022-02-164-16/+24
| | | | |
| * | | | Implement HasKind for tor-chanmgr::ErrorNick Mathewson2022-02-161-2/+6
| | | | | | | | | | | | | | | | | | | | (There will be a folowup to work on internal errors here.)
* | | | | Merge branch 'netdir-error' into 'main'Ian Jackson2022-02-162-32/+9
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | Simplify tor-netdir::Error by a *lot* See merge request tpo/core/arti!319
| * | | | tor-netdir: Split testnet errors into a new typeNick Mathewson2022-02-152-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to have the test-network-construction code share an error enum with the main netdir code.
| * | | | tor-netdir: remove unused error variantsNick Mathewson2022-02-151-19/+0
| |/ / / | | | | | | | | | | | | | | | | This turns out to have been most of them, which simplifies matters a lot.
* | | | Merge branch 'cell-proto-error' into 'main'Nick Mathewson2022-02-1620-107/+289
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | tor-cell and tor-proto: provide HasKind. See merge request tpo/core/arti!304
| * | | tor_proto::Error: Fix an incomplete sentence.Nick Mathewson2022-02-161-1/+2
| | | |
| * | | Update tor-proto errors to latest API.Nick Mathewson2022-02-1511-43/+41
| | | |
| * | | Update tor-cell errors to latest APINick Mathewson2022-02-151-4/+4
| | | |
| * | | Make tor-proto::Error implement HasKind.Nick Mathewson2022-02-154-27/+121
| | | | | | | | | | | | | | | | | | | | | | | | This took some refactoring, and gave an opportunity to notice a few error variants that weren't being used, or didn't mean what they said on the tin.
| * | | tor-proto: use InternalError for internal errors.Nick Mathewson2022-02-1513-45/+84
| | | |
| * | | tor-cell: provide HasKind.Nick Mathewson2022-02-159-31/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additionally, refactor the IoError out of tor_cell::Error: nothing in TorCell created this; it was only used by tor_proto. This required refactoring in tor_proto to use a new error type. Here I decided to use a new CodecError for now, though we may refactor that away soon too.
* | | | Merge branch 'ticket_344' into 'main'eta2022-02-161-5/+24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Refactor tor-netdoc a bit more, to use Bug right. See merge request tpo/core/arti!316
| * | | | Fix a rustdoc error.Nick Mathewson2022-02-151-1/+1
| | | | |
| * | | | Refactor tor-netdoc a bit more, to use Bug right.Nick Mathewson2022-02-151-4/+23
| | |/ / | |/| |
* / | | Move persistent state flush from client to circmgrYuan Lyu2022-02-152-15/+13
|/ / /
* | | Minimal compilation fix: InternalError=>BugNick Mathewson2022-02-151-2/+2
| | | | | | | | | | | | This is a followup for !314 and !310 to fix compilation on main.
* | | Merge branch 'doc-errors' into 'main'Nick Mathewson2022-02-1521-399/+579
|\ \ \ | |/ / |/| | | | | | | | Refactor errors in tor-netdoc See merge request tpo/core/arti!314
| * | Typo fix from@etaeta2022-02-151-1/+1
| | |
| * | Refactor tor_netdoc::ErrorNick Mathewson2022-02-1416-378/+552
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This error type doesn't impement HasKind, since the kind will depend on context. However, the existing implementation was pretty messy and inconsistent: Some errors had positions, some didn't. Some took messages as str, some as String. Some had internal errors that were somewhat orthogonal to their actual types. This commit refactors tor_netdoc::Error to use a ParseErrorKind, and adds a set of convenience functions to add positions and messages to the errors that need them.
| * | netdoc: Make doc-build errors a separate typeNick Mathewson2022-02-147-13/+30
| | | | | | | | | | | | | | | Every other case of tor_netdoc::Error means a parse failure. This one, though, means a failure to construct a document.
| * | netdoc: remove Error::Untimely.Nick Mathewson2022-02-141-11/+0
| | | | | | | | | | | | Nothing creates this.
* | | tor_error::Bug: change Display impl to use kindIan Jackson2022-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/310#note_2777626 The message from the kind is precisely right.
* | | BadApiUsage: change Display impl capitalisationIan Jackson2022-02-151-1/+1
| | | | | | | | | | | | Now it maches the others
* | | Rename BadApiUsage from BadAPIUsageIan Jackson2022-02-152-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/310#note_2777519 mutatis mutandi. And, fix a leftover instance with an old idea of what this was called.
* | | tor-socksproto: Use bad_api_usage! rather than ad-hoc Invalid errorIan Jackson2022-02-152-8/+3
| | |