summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | rpc: List missing required features in error dataNick Mathewson2024-10-171-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our spec says that when the RPC client has said "I require you to have feature X" and we don't have it, we need to include the feature(s) we don't have in an `rpc:unsupported_features` field of our error. Also, add an integration test for this behavior. Closes #1662
* | | | rpc: Include "data" field in error.Nick Mathewson2024-10-171-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In older versions of the rpc spec, this field held a serialized version of the Arti error object. That's no longer the design: now it provides a way for specific errors to include extra, specified, machine-readable data. For more information see the section "Errors" in rpc-meta-draft.md
* | | | Remove Rpc* variants from tor_error::ErrorKindNick Mathewson2024-10-178-92/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are not regular ErrorKinds, since they can never occur in an error that's meant to be returned from a Rust API like `arti-client`. Instead, they only exist for errors returned from RpcError. (I can't find the place where we discussed this previously, but the rationale is that if an ErrorKind never makes sense in response to something that the user does from Rust, we should never have that be an ErrorKind. The fact that the removed kinds do not actually appear outside the RPC system suggests that this is reasonable.)
* | | | rpcserver: Wrap InvokeError as internal errorNick Mathewson2024-10-173-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm about to remove HasKind from InvokeError, which would otherwise break this code. These errors are all in fact internal errors, since in this context they can only stem from incorrectly formed calls to `invoke_special_method`.
* | | | Tweak some RpcErrorKind member names.Nick Mathewson2024-10-171-4/+4
| | | | | | | | | | | | | | | | In some cases, the tor_error::ErrorKind names were nicer.
* | | | rpc: Create a constructor for RpcError.Nick Mathewson2024-10-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll use this to make RpcErrors directly, without having to go through an error that implements HasKind. Later, we'll add the ability to set the `data` fields on an RpcError.
* | | | rpc: Allow the "RpcError.kinds" to be an RpcErrorKind.Nick Mathewson2024-10-172-11/+33
| | | | | | | | | | | | | | | | | | | | This change will let us start removing the not-entirely-logical `Rpc.*` variants from tor_error::ErrorKind.
* | | | rpc: Make RpcErrorKind public.Nick Mathewson2024-10-172-2/+3
| | | |
* | | | rpc: Rename RpcCode to RpcErrorKind.Nick Mathewson2024-10-171-6/+13
| | | | | | | | | | | | | | | | This is about to be a public competitor with tor_error::ErrorKind.
* | | | rpc: Use an alias for RpcCode.Nick Mathewson2024-10-171-9/+10
| | | |
* | | | rpc: Remove prefix from RpcCode members.Nick Mathewson2024-10-171-20/+19
|/ / /
* | / memquota: suppress clippy::single_match warning.Nick Mathewson2024-10-171-0/+1
| |/ |/| | | | | | | "Suppress" rather than "fix": this pattern is intentional, and makes it clear that we're doing an exhaustive match.
* | Merge branch 'tor-key-forge-cleanup' into 'main'gabi-2502024-10-173-7/+12
|\ \ | | | | | | | | | | | | tor-key-forge: Minor cleanups and reformatting See merge request tpo/core/arti!2552
| * | tor-key-forge: Fix typo in documentation.Gabriela Moldovan2024-10-171-2/+2
| | |
| * | tor-key-forge: Replace fully-qualified path with import.Gabriela Moldovan2024-10-171-2/+2
| | | | | | | | | | | | | | | `KeypairData` is already in scope, so there's no need to fully-qualify it.
| * | tor-key-forge: Reformat derives for readability.Gabriela Moldovan2024-10-171-2/+4
| | |
| * | tor-key-forge: Reformat a long line for readability.Gabriela Moldovan2024-10-171-1/+4
| | |
* | | Merge branch 'dead' into 'main'Alexander Hansen Færøy2024-10-1712-3/+41
|\ \ \ | | | | | | | | | | | | | | | | Disable a lot of dead code warnings and add a default-runtime feature in arti See merge request tpo/core/arti!2551
| * | | arti: Introduce a new default-runtime Cargo featureIan Jackson2024-10-172-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Now one can do a minimal build with cargo build -p arti --no-default-features --features=default-runtime rather than needing to specify tokio,native-tls.
| * | | Disable a lot of dead code warnings (fmt)Ian Jackson2024-10-173-3/+12
| | | |
| * | | Disable a lot of dead code warningsIan Jackson2024-10-1710-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* | | | Merge branch 'chanmgr-select-docs' into 'main'David Goulet2024-10-171-0/+25
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | tor-chanmgr: update comments about selecting pending channels See merge request tpo/core/arti!2544
| * | | | tor-chanmgr: update comments about selecting pending channelsSteven Engler2024-10-161-0/+25
| | | | |
* | | | | Merge branch 'orport' into 'main'David Goulet2024-10-172-224/+309
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-chanmgr: refactored to remove `with_channels` and added `PendingChannelHandle` See merge request tpo/core/arti!2538
| * | | | | tor-chanmgr: remove `handle_build_outcome`Steven Engler2024-10-151-28/+19
| | | | | |
| * | | | | tor-chanmgr: `PendingChannelHandle` removes the channel when droppedSteven Engler2024-10-152-27/+56
| | | | | |
| * | | | | tor-chanmgr: added `PendingChannelHandle`Steven Engler2024-10-152-36/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handle contains all of the details required to remove or replace a pending channel entry from the channel map.
| * | | | | tor-chanmgr: refactor so we don't need `with_channels{,_and_params}`Steven Engler2024-10-152-78/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods on `MgrState` acquire a lock, and it's easy for calling code to also try to acquire the same lock within the closure, causing a deadlock. It's better to not expose these methods.
| * | | | | tor-chanmgr: fix some incorrect commentsSteven Engler2024-10-152-5/+3
| | | | | |
| * | | | | tor-chanmgr: removed use of `with_channels` within `request_channel`Steven Engler2024-10-151-61/+66
| | | | | | | | | | | | | | | | | | | | | | | | Best reviewed with the '-w' flag to hide whitespace changes.
| * | | | | tor-chanmgr: refactored `AbstractChanMgr::choose_action`Steven Engler2024-10-152-109/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves most of the channel map logic from `AbstractChanMgr::choose_action` to `MgrState::request_channel`. This is working towards being able to remove `MgrState::with_channels{,_and_params}`.
* | | | | | rtcompat: Fix android compilation in `general`Nick Mathewson2024-10-171-1/+3
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously I had assumed that `std::os::linux` also existed on android, based on the documentation of `std::os::linux::net::SocketAddrExt`. That is not, however, true. This should fix the `check-targets` CI job.
* | | | | Merge branch 'fs-watcher-poll' into 'main'gabi-2502024-10-175-4/+56
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tor-config: Use a polling watcher on non-windows platforms that don't have inotify. Closes #1644 See merge request tpo/core/arti!2547
| * | | | | arti: Add a warning about watch_configuration's performance issues.Gabriela Moldovan2024-10-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Part of #1644
| * | | | | tor-config: Document the limitations of the FileWatcher.Gabriela Moldovan2024-10-162-0/+11
| | | | | |
| * | | | | arti: Enable tor-config/testing when testing.Gabriela Moldovan2024-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables us to make use of the unfortunately-necessary test-specific code path.
| * | | | | tor-config: Compare the file contents when testing.Gabriela Moldovan2024-10-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When testing, compare the contents of the files too, not just their mtime Otherwise, because the polling backend detects changes based on mtime, if the test creates/writes files too fast, it will fail to notice changes (this can happen, for example, on a tmpfs).
| * | | | | tor-config: Configure the polling interval.Gabriela Moldovan2024-10-161-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default is 30s, which feels a bit too long. Also, when testing, we use a much shorter interval. This is meant to be a temporary solution, so we hard-code the interval rather than make it configurable.
| * | | | | tor-config: Use a polling watcher on non-windows platforms that don't have ↵Gabriela Moldovan2024-10-162-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inotify. On windows and platforms that support inotify (i.e. linux and android), we continue using the recommended watcher. On platforms that use kqueue, we switch to a polling watcher to work around a [notify bug] that manifests when using a non-recursive watcher to watch a directory. This commit is best reviewed with `git diff --ignore-all-space`. Closes #1644 [notify bug]: https://github.com/notify-rs/notify/issues/644
| * | | | | tor-config: Add a type alias for the underlying watcher (fmt).Gabriela Moldovan2024-10-161-2/+2
| | | | | |
| * | | | | tor-config: Add a type alias for the underlying watcher.Gabriela Moldovan2024-10-161-3/+6
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | This type will soon become platform-dependent, so I am preemptively adding a type alias.
* | | | | Merge branch 'general_socketaddr_ops' into 'main'Nick Mathewson2024-10-176-2/+518
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | general::SocketAddr: Specify and implement string representations. Closes #1681 See merge request tpo/core/arti!2519
| * | | | | rtcompat: Add a fuzzer for round-trip general::SocketAddr parsing.Nick Mathewson2024-10-164-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | (This turned up another place where we need documentation.)
| * | | | | rtcompat: Add a fuzzer for general::SocketAddr parsingNick Mathewson2024-10-163-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fuzzer makes sure that whatever we can parse, we can format into an object that is parsed in the same way.
| * | | | | general::SocketAddr: Format the unnamed address as "unix:"Nick Mathewson2024-10-161-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches our parsing, and our general rule that our parser defers to SocketAddr::from_pathname.
| * | | | | Add reverse-enginered description of Rust socketaddr formats.Nick Mathewson2024-10-161-0/+32
| | | | | |
| * | | | | general::SocketAddr: Add unit testsNick Mathewson2024-10-162-38/+70
| | | | | |
| * | | | | general::SocketAddr: Implement PartialEq.Nick Mathewson2024-10-161-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | Needed for tests.
| * | | | | general::SocketAddr: Specify and implement string representations.Nick Mathewson2024-10-161-1/+285
| | |_|/ / | |/| | | | | | | | | | | | | Closes #1681.
* | | | | Merge branch 'fix-arti-relay-deps' into 'main'opara2024-10-164-50/+1
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | arti: remove 'relay' subcommand and 'arti-relay' dependency See merge request tpo/core/arti!2542