summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+6
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Merge branch 'relay-bin-4' into 'main'opara2025-11-111-1/+3
|\ | | | | | | | | arti-relay: Add OR port listener task See merge request tpo/core/arti!3396
| * tor-chanmgr: wrap the peer address in `Sensitive`Steven Engler2025-11-051-1/+3
| | | | | | | | | | For incoming connections, wrap the peer address in `Sensitive` as it could be a client.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
|/ | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* 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.
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-201-2/+7
| | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* 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.
* tor-chanmgr: add `util::defer` moduleSteven Engler2024-11-271-0/+1
| | | | | This contains the `Defer` type, which can be used to defer a closure until the `Defer` is dropped.
* tor-chanmgr: fix reconfigure bug when given `CheckAllOrNothing`Steven Engler2024-11-121-2/+9
| | | | We shouldn't actually reconfigure anything if given `CheckAllOrNothing`.
* tor-chanmgr: fix `unused_imports` warning on `ChannelAccount`Steven Engler2024-10-091-1/+3
|
* tor-proto: Make circuit->channel queues participate in memquotaIan Jackson2024-10-031-1/+12
| | | | | | | | We use the *channel*'s memquota account. This is arguably wrong, but it's hard to get right now. See #1652. Change the type of the queue, and the places it's constructed. The use sites can all stay the same.
* tor-proto: Plumb the ChannelAccount through to queue creation siteIan Jackson2024-10-031-2/+3
| | | | | This gets it as far as the outbound circuit->channel mpsc queue creation. Also, we provide an accessor for it.
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-1/+6
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* memquota: Add a toplevel account in tor-chanmgr (pre-fmt)Ian Jackson2024-10-031-1/+2
|
* tor-proto: Reformat a doc commentIan Jackson2024-09-261-3/+6
| | | | | | Make it have a summary line of only reasonable size. While we're here, wrap the body with semantic linefeeds.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-241-1/+1
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* tor-chanmgr: add experimental `ChanMgr::handle_incoming`Steven Engler2024-09-111-0/+13
| | | | | | | | | The channel manager in the future will need to be able to receive incoming streams. The type of the stream depends on an associated type within `ChannelFactory`, so this commit exposes this associated type through several other types, eventually to the `ChanMgr`. The new methods are behind the experimental "relay" feature flag.
* tor-chanmgr: make `CompoundFactory` generic over `ChannelFactory`Steven Engler2024-09-111-2/+6
| | | | | | | | | | This has two advantages: 1. Code is a little easier to follow with generics rather than dynamic dispatch, especially since the type is fixed at compile time anyways. 2. It allows us to access associated types of the `ChannelFactory`, which will be useful later for getting the stream type from the `ChanBuilder`.
* proto: Make Channel explicitly Arc<.>Nick Mathewson2024-05-161-2/+2
| | | | | | | | | | | | | | | | Previously, Channel was a type that you could Clone that implicitly its state. Now, Channel always appears as an Arc<Channel>. This change has several benefits: * It makes the relationship between Channel struct and the underlying channel more clear. * It enables Channel to participate in the RPC system, where everything has to be an Arc<.> * It enables us to have a Weak<Channel>, if we ever want to. * It will let us move various members out of ChannelDetails. We did this change a while ago with ClientCirc.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* 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-4/+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.
* continually_expire_channels: don't round off expiration delayJim Newsome2023-12-131-1/+1
| | | | | | | | | Without this change, if the delay is less than one second, the code will effectively busy-loop until the delay has elapsed. This potentially leads to deadlock in shadow simulations, and wastes CPU in real usage. https://shadow.github.io/docs/guide/limitations.html?highlight=busy#busy-loops
* continually_expire_channels: refactor using let-elseJim Newsome2023-12-131-3/+2
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Fix a pair of rustdoc links in chanmgr.Nick Mathewson2023-07-191-2/+2
|
* Move an import to resolve a warning.Nick Mathewson2023-07-131-1/+2
|
* Explain better why you would use build_unmanaged_channelNick Mathewson2023-07-131-2/+7
|
* Resolve numerous typos in `ChanMgr::build_unmanaged_channel` codegabi-2502023-07-131-4/+4
|
* chanmgr: Remove now-unused (and never usable) builder() method.Nick Mathewson2023-07-131-12/+0
|
* chanmgr: Document makeup and timeout behavior of our factoriesNick Mathewson2023-07-131-0/+22
| | | | | Basically, it's all ChanBuilder at some point, and ChanBuilder has a timeout.
* chanmgr: Add an experimental build_unmanaged_channel() method.Nick Mathewson2023-07-131-0/+26
| | | | | This method will let the user construct a channel that isn't stored or monitored by the ChanMgr.
* Gate builder() behind experimental-api featureSaksham Mittal2023-07-121-1/+1
|
* Merge branch 'channelfactory' into 'main'Nick Mathewson2023-07-121-1/+7
|\ | | | | | | | | Expose channel builder in order to create channels more efficiently in external code See merge request tpo/core/arti!1374
| * Mark builder() as experimentalSaksham Mittal2023-07-061-0/+1
| |
| * Import ChannelFactory instead of CompoundFactorySaksham Mittal2023-07-061-3/+3
| |
| * Rename get_channelbuilder() to builder()Saksham Mittal2023-07-061-1/+1
| |
| * Remove now unnecessary lines for importSaksham Mittal2023-07-051-2/+0
| |
| * Import CompoundFactory regardless of feature levelSaksham Mittal2023-07-051-3/+1
| |
| * Create new method to expose CompoundFactorySaksham Mittal2023-07-051-0/+9
| |
* | Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
| |
* | Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.
* ChanMgr: Tweak documentation a bit.Nick Mathewson2023-06-281-9/+13
| | | | | Adjust formatting, add more references to lower-level APIs, and clarify lifetimes a little more.
* Add Channel expiry info in ChanMgr docsSaksham Mittal2023-06-271-0/+7
|