summaryrefslogtreecommitdiff
path: root/crates/tor-ptmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-ptmgr: pass through the `CfgPathResolver`Steven Engler2024-11-181-1/+4
|
* ptmgr: Warn on non-local unmanaged PTsNick Mathewson2024-09-251-0/+7
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-2/+3
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-ptmgr: added a 'managed-pts' default featureSteven Engler2024-08-211-72/+92
| | | | | This conditionally compiles most of the code related to managed transports.
* tor-ptmgr: break out `spawn_transport` into separate functionSteven Engler2024-08-201-33/+38
|
* tor-ptmgr: moved `PtClientMethod` from ipc to crate moduleSteven Engler2024-08-201-1/+23
|
* tor-ptmgr: move some code to a new 'managed' moduleSteven Engler2024-08-201-311/+11
| | | | | | Code that's related to managed transports has been moved to a new 'managed' module. This includes the PT reactor since it's not needed for unmanaged transports.
* tor-ptmgr: fix warnings when 'tor-channel-factory' isn't enabledSteven Engler2024-08-201-1/+4
|
* tor-ptmgr: added the `TransportOptions` enumSteven Engler2024-08-201-25/+22
| | | | | | | | This is a little nicer and more type-safe to work with than `TransportConfig`. It would have been nice to change `TransportConfig` directly instead, but it would slightly change arti_client's public API, and would require an extra field in the `[[bridges.transports]]` toml table.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-ptmgr: Comment fixesgabi-2502024-03-141-1/+1
|
* Move comment from factory_for_transport.Nick Mathewson2024-03-141-21/+21
|
* Clean up parts of the ptmgr docs that assume managed ptsNick Mathewson2024-03-141-2/+2
|
* Teach get_cmethod_for_transport to handle unmanaged transports.Nick Mathewson2024-03-141-3/+9
| | | | | | | This will suffice to bypass the reactor when we're dealing with an unmanaged pluggable transport. Closes #755.
* Lightly refactor get_cmethod_for_transportNick Mathewson2024-03-141-40/+41
| | | | Now that it's extracted, we can remove a mut and some nesting.
* Rename cmethods => managed_cmethodsNick Mathewson2024-03-141-7/+11
|
* Extract cmethod lookup from factory_for_transport.Nick Mathewson2024-03-141-59/+77
|
* Adapt TransportConfig to support unmanaged transports.Nick Mathewson2024-03-141-5/+17
| | | | | | | | | | | This is based on an original branch by Trinity. Instead of its original approach, which used an enum in the configuration to distinguish managed from unmanaged transports, this branch uses builder validation function to ensure that incompatible options aren't used together. Doing the lets us generate better error messages. Thanks: trinity-1686a <[email protected]>
* Rename ManagedTransportConfig to TransportConfig.Nick Mathewson2024-03-141-8/+8
| | | | We're going to start using this type for _every_ kind of transport.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-ptmgrIan Jackson2023-10-111-1/+1
|
* Add initial support for running a PT in server modeSaksham Mittal2023-08-241-10/+22
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* 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-3/+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.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Use ErrorReport for errors in error! in tor-ptmgrIan Jackson2023-01-301-1/+2
|
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* ptmgr: Add more logs when looking/creating a PT.Nick Mathewson2023-01-061-24/+46
| | | | | | | These are also based on temporary logs that I added locally while I was hunting bugs. Also part of #677.
* Hang onto a PT object after it is launchedNick Mathewson2022-11-301-0/+1
| | | | | | | If we don't do this, then snowflake's stdin will get closed and it will exit immediately. Found while investigating #333.
* ptmgr todo: Remove dead code allowIan Jackson2022-11-301-2/+0
|
* ptmgr: No need for state_dir in PtMgrIan Jackson2022-11-301-4/+1
| | | | This is used exclusively by the reactor.
* ptmgr todo: Tolerate exposing the Vec for nowIan Jackson2022-11-301-1/+1
| | | | | We may want to change this later, but this API is in a low level crate, so this isn't a blocker.
* Merge branch 'no_empty_select' into 'main'eta2022-11-301-1/+9
|\ | | | | | | | | | | | | ptmgr: Do not construct an empty select_all future. Closes #672 and #670 See merge request tpo/core/arti!907
| * ptmgr: Do not construct an empty select_all future.Nick Mathewson2022-11-301-1/+9
| | | | | | | | | | | | Closes #670. Closes #672.
* | ptmgr: change error UnconfiguredTransportDueToConcurrentReconfigurationIan Jackson2022-11-301-1/+1
|/ | | | | | | | Rename it from UnconfiguredTransport. Change descriptions, kind, and retry. Add a TODO. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858455
* ptmgr: report an error if PT transports don't match requested.Nick Mathewson2022-11-291-1/+9
| | | | | (I think this may be impossible now, since we check in ipc.rs, but IMO it's best to check.)
* Register transport in pt reactor even if it has no pending requestsNick Mathewson2022-11-291-1/+1
|
* ptmgr: Use PluggableTransport::identity in logs.Nick Mathewson2022-11-291-2/+2
| | | | This lets us avoid logging the user's path.
* Centralize the "find an identifier for the pt name" logic in one place.Nick Mathewson2022-11-291-6/+36
|
* tor-ptmgr: add PtReactoreta2022-11-291-18/+205
| | | | | | This fleshes out the PtReactor that was previously a stub, making it actually do reactor-ey things. Note that this is entirely untested, and might not work at all. Hopefully it does, though.
* PtMgr: Use a persistent state directory for PT state.Nick Mathewson2022-11-281-9/+8
| | | | | | | | | | This makes a `pt_state` directory inside .local/share/arti (or the local equivalent), right next to our existing `state` dir. Ideally we would use a separate directory for each PT, but we have a very fuzzy "what is a specific PT" notion. Closes #667
* Revise the API of "PtMgr::reconfigure"Nick Mathewson2022-11-281-2/+7
| | | | | | | | I prefer that it not take `&mut self`, since PtMgr already has interior mutability. I also need it to take `tor_config::Reconfigure` argument, in case it gains any more smarts about validation in the future.
* ptmgr: Note a TODO issue around TempDir.Nick Mathewson2022-11-281-0/+2
|
* ptmgr: Fill in some error-related code; resolve TODOs.Nick Mathewson2022-11-281-2/+10
|
* ptmgr: clear up unused_import exceptions.Nick Mathewson2022-11-281-16/+15
|
* Draft: Pluggable transport managereta2022-11-281-21/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements `PtMgr`, a pluggable transport manager responsible for keeping track of spawned PTs and spawning them to satisfy client requests on demand. It does this in two parts: the `PtMgr` type exported to the rest of the code, and the background `PtReactor` that actually does the spawning; this design ensures that only one attempt to spawn a PT is active at a time, and will prove useful later for implementing e.g. timeouts. A few changes were necessary to the rest of the code in order to make this all work out. Namely: - `TransportRegistry`'s API didn't make any sense for two reasons: - It wasn't feasible for implementors to implement `ChannelFactory`, since that'd require constructing a `ChanBuilder` (which requires a bootstrap reporting event sender). - Treating the PT manager as a registry is over-general; it's only necessary for it to spawn pluggable transports, so saddling it with other concerns didn't make any sense. - (It's possible to get extensibility for arbitrary user customization by just letting the user swap in a new `ChannelFactory`, anyway.) - Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which is far more narrowly focused; this only exists to solve a dependency loop, and is documented as such. - This provides a `TransportHelper` instead of a `ChannelFactory`.
* Replace TransportRegistry with AbstractPtMgreta2022-11-221-32/+1
| | | | | | | | | | | | | | | | | | It doesn't make much sense to have the pluggable transport manager be a registry, so replace its interface with a more narrowly defined, less generic version. Other changes: - instead of returning a &-reference, it returns an owned Arc, which should make the ptmgr easier to implement while allowing efficient reuse - provision for error handling is added, but will probably be revised in a future commit pending discussion - tor-ptmgr code that would generate warnings as a result of this change is temporarily removed This is a split out version of arti!886, intended so work on arti#659 can proceed.