summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* tor-chanmgr: add base64ct dependency and docsNihal2026-03-181-1/+1
|
* linkspec: Implement a RelayIdsBuilder::from_relay_ids()David Goulet2026-03-031-0/+18
| | | | | | | | | This is used when we build an OwnedChanTarget using the builder. Instead of going identities by identities at the callsite, we can use this helper to get us a RelayIds builder and set it in the OwnedChanTargetBuilder. Signed-off-by: David Goulet <[email protected]>
* proto: Implement Display for PeerAddrDavid Goulet2026-03-031-0/+10
| | | | | | This required to implement Display for PtTarget. Signed-off-by: David Goulet <[email protected]>
* linkspec: Add missing feature gateDavid Goulet2026-02-191-0/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* proto: Enforce that channel method as unique SocketAddrDavid Goulet2026-02-121-0/+20
| | | | | | | | | | | | | During the channel handshake, we require the peer IP address for the canonicity check which requires the exact peer IP we are connected to. This commit adds a function that enforces this requirement on a ChannelMethod so anything else results in an error. It is to basically have stronger guarantee on the channel method we use in the handshake. Signed-off-by: David Goulet <[email protected]>
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* linkspec: Remove comment about expense of cloning protocols.Nick Mathewson2025-12-031-2/+0
|
* linkspec: allow unstable_name_collisions lint for exactly_one()Gabriela Moldovan2025-12-011-0/+5
| | | | This silences a new warning on nightly.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0610-10/+10
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an Iterator (fmt)Ian Jackson2025-10-061-1/+3
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-064-23/+36
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* circmgr: Don't count channel negotiation towards circuit built time.Nick Mathewson2025-08-071-0/+5
| | | | | | | | | | This is important, since some circuits require us to negotiate a new channel, and some don't: by adding this variability, we can easily learn a timeout based on pre-existing channels to our guards, but then later time out if it takes a while to open a TLS connection. This is a possible solution to part of #2079, a bug where we "learn" a circuit timeout that is too low for us to satisfy.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-074-6/+9
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-linkspec,tor-basic-utils: remove deprecated `empty_iterator()` methodSteven Engler2025-05-141-3/+1
| | | | | | This method has always been deprecated, so it's not a big deal to remove. It can be replaced with the corresponding iterators's `Default` implementation.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* linkspec: Fix nightly warning about elided lifetimeNick Mathewson2024-10-221-1/+1
| | | | | | This warning shows up when running `cargo +nightly doc`. Apparently nightly doesn't like it when we have elided a lifetime that has a perfectly good name.
* Some HasMemoryCost impls in tor-linkspecIan Jackson2024-10-021-2/+8
|
* tor-chanmgr: don't allow pending channels with no relay idsSteven Engler2024-10-011-1/+1
|
* Merge branch 'orport' into 'main'opara2024-09-303-13/+479
|\ | | | | | | | | tor-chanmgr: support multiple channels for a relay ID See merge request tpo/core/arti!2442
| * tor-linkspec: add `ListByRelayIds`Steven Engler2024-09-232-13/+472
| | | | | | | | Like `ByRelayIds`, but allows multiple items per relay ID.
| * tor-linkspec: impl `HasAddrs` for `&T`Steven Engler2024-09-231-0/+7
| | | | | | | | | | This makes the `HasAddrs` trait nicer to use when most things that have addresses are passed by reference anyways.
* | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-7/+7
|/ | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_test (fmt)Ian Jackson2024-09-121-2/+8
|
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_testIan Jackson2024-09-121-6/+6
| | | | No semver implications since this wasn't in the last release.
* tor-bytes: Add a Reader constructor for use in testsIan Jackson2024-09-111-4/+4
| | | | | | | | | | | | We could call from_possibly_incomplete_slice in these, but that's confusing and distracting. Here we add this constructor, and document it (in terms of the constructor to come), and change the call sites. No functional change. Doing this now will prevent unwanted changes to test behaviours when we change the behaviour of Readers made by Reader::from_slice.
* Change tor_bytes::Readable name to `b` in many placesIan Jackson2024-09-111-3/+3
| | | | | | | | | | | | | | | The codebase uses `r` sometimes and `b` at other times. Making this consistent makes widespread changes easier, and is clearer for humans. I think `b` is better than `r` because `r` might be "return". It is indeed used that way in a couple of places in reader.rs, even. I haven't changed *everywhere*, just Readable impls (where `r` is particularly likely to be "return value") and occurrences in tor-bytes. No functional change.
* Introduce and use tor_bytes::Error::new_truncated_for_testIan Jackson2024-09-101-6/+6
| | | | | | | | This is going to want to do something more complicated (as described in the docs). In this commit we change all the tests that are expecting Truncated errors. That reduces noise in the next commit.
* tor-linkspec: reading tests: Use assert_eqIan Jackson2024-09-101-6/+6
| | | | | | | Error::Truncated is going to become more complicated, and anyway it would be nice to print the values if the test fails. Error is PartialEq now. (Maybe it wasn't when this was written?)
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-linkspec: Suppress clippy false positive (link ticket)Ian Jackson2024-04-031-1/+1
|
* tor-linkspec: Suppress clippy false positiveIan Jackson2024-04-031-0/+1
|
* tor-netdir: Abolish Relay::has_same_relay_idsIan Jackson2024-04-031-1/+0
| | | | This was an open-coded specialisation. Remove the one call site.
* tor-linkspec: Use derive-deftly rather than strum for same_relay_idsIan Jackson2024-04-033-1/+42
|
* tor-linkspec: Use RelayIdType::all_types rather than ::iterIan Jackson2024-04-031-2/+2
| | | | | This will make it slightly easier to find these call sites if we want to change them in the future.
* Run maint/add_warning.Nick Mathewson2024-03-139-0/+9
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-3/+2
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* tor-linkspec: Provide HasRelayIds::has_any_relay_id_from (fmt)Ian Jackson2023-08-291-3/+3
| | | | Worsify formatting as demanded by rustfmt.
* tor-linkspec: Provide HasRelayIds::has_any_relay_id_fromIan Jackson2023-08-291-0/+67
| | | | | This seems logically necessary, and I want to use it in intro point selection.
* linkspec: Derive Clone and Copy for VerbatimLinkSpecCircTarget.Nick Mathewson2023-08-241-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-239-0/+9
|
* Lower linkspec list parsing into new tor-linkspec method.Nick Mathewson2023-08-221-1/+20
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* tor-linkspec: impl AsRef<str> for PtTransportNameIan Jackson2023-07-201-0/+6
|