summaryrefslogtreecommitdiff
path: root/crates/tor-ptmgr/src/ipc.rs
Commit message (Collapse)AuthorAgeFilesLines
* ptmgr: Remove string slicing.Nick Mathewson2026-06-101-11/+11
|
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+2
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-ptmgr: port to web-time-compat.Nick Mathewson2026-03-261-4/+4
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | 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.
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+1
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* Use mpsc_channel_no_memquota next to a TODOIan Jackson2024-10-151-3/+2
| | | | We have a ticket for this. But the ticket number was wrong, so fix that.
* memquota: Note a TODO about PT channelsIan Jackson2024-10-021-0/+1
|
* ptmgr: Forbid managed pts on non-localhostNick Mathewson2024-09-251-0/+7
|
* tor-ptmgr: moved `PtClientMethod` from ipc to crate moduleSteven Engler2024-08-201-21/+1
|
* tor-ptmgr: move some code to a new 'managed' moduleSteven Engler2024-08-201-1/+1
| | | | | | 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.
* Add test for PtStatus containing TRANSPORT field.Alexander Færøy2024-08-011-0/+10
| | | | See: tpo/core/arti#1488.
* Don't require TRANSPORT for PT STATUS messages.Alexander Færøy2024-08-011-18/+4
| | | | | | | | | | | | | | | This patch changes the PT STATUS handler to not require the presence of the `TRANSPORT` field in the K/V line. This matches current behaviour of C Tor and was requested by the Anti-censorship Team at an earlier point to enable STATUS messages to work for situation where it's not transport specific messages. To avoid future issues, we simply ignore any required keys right now even though TYPE is to be expected. See: tpo/core/torspec#267 See: tpo/core/torspec!63 See: tpo/core/arti#1488
* Merge branch 'encapsulate_config_rs' into 'main'Nick Mathewson2024-03-131-1/+1
|\ | | | | | | | | Encapsulate usage of config-rs inside tor-config. See merge request tpo/core/arti!2040
| * ptmgr: Use Itertools directly.Nick Mathewson2024-03-131-1/+1
| | | | | | | | Previously it used tor_config::Itertools, which is silly.
* | Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|/
* Use tor_basic_utils::PathExt::display_lossyIan Jackson2024-03-051-1/+2
| | | | | Change Path::display to this new function, in call sites where it's being used for a diagnostic.
* Merge branch 'todo-not-hss' into 'main'Alexander Færøy2023-10-221-1/+1
|\ | | | | | | | | Remove an "HSS" from a "TODO HSS" comment in ptmgr See merge request tpo/core/arti!1676
| * Remove an "HSS" from a "TODO HSS" comment in ptmgrNick Mathewson2023-10-161-1/+1
| | | | | | | | This isn't actually onion service related, AFAICT.
* | tor-ptmgr: Handle unsupported escapesEmil Engler2023-10-171-1/+8
|/
* Resolve ClientTransportLaunched and ServerTransportLaunched in different armsSaksham Mittal2023-09-131-24/+26
|
* Rename ClientTransportGaveError to TransportGaveErrorSaksham Mittal2023-09-131-1/+1
|
* Deduplicate ClientTransportLaunched and ServerTransportLaunchedSaksham Mittal2023-09-111-106/+135
| | | | | | | Note: this isn't perfect, though it moves both match arms to try_match_common_messages, it does end up resolving them separately using a helper function, and also necessitated creating another function in the PluggableTransportPrivate trait
* Deduplicate ClientTransportFailed and ServerTransportFailedSaksham Mittal2023-09-111-22/+11
|
* Import sealed module to avoid syntactic vinegarSaksham Mittal2023-09-111-14/+15
|
* tor-ptmgr: Test for empty valuesEmil Engler2023-09-071-0/+7
| | | | | | | This commit adds a unit test that checks if an empty value is parsed properly. It fixes the coverage in `crates/tor-ptmgr/src/ipc.rs:120`.
* tor-ptmgr: Test for missing valuesEmil Engler2023-09-071-0/+6
| | | | | This commit adds a test which checks for a missing value in an SMETHOD argument.
* tor-ptmgr: Test for forbidden `=`Emil Engler2023-09-071-0/+6
| | | | | This commit adds a unit test to the `tor-ptmgr` crate, which checks for forbidden `=` signs while reading a value.
* tor-ptmgr: Test argument ending with backslashEmil Engler2023-09-071-0/+6
| | | | | This commit adds a unit test to the `tor-ptmgr` crate, which checks if arguments are terminated with a backslash, which is forbidden.
* tor-ptmgr: Test unsupported octal sequencesEmil Engler2023-09-071-0/+9
| | | | | This commit adds a unit test that checks if all octal escape sequences are treated as an unsupported error.
* tor-ptmgr: Test escape sequencesEmil Engler2023-09-071-0/+8
| | | | | This commit adds a test to the `tor-ptmgr` crate, which increases the test coverage by checking for escape sequences in values.
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-051-0/+2
| | | | I have no idea why these became necessary.
* Add initial support for running a PT in server modeSaksham Mittal2023-08-241-291/+620
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* 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-7/+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.
* Use ErrorReport - run rustfmtIan Jackson2023-01-301-1/+5
| | | | Split off for ease of review and possible rebase.
* Use ErrorReport for errors in warn! in tor-ptmgrIan Jackson2023-01-301-3/+3
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* ptmgr: Add more logging to IPC code.Nick Mathewson2023-01-061-9/+34
| | | | | | | | This is based on logs that I added locally while I was trying to debug some startup issues. Hopefully they'll make things easier the next time there's something to debug. Part of #677.
* ptmgr: report an error if PT transports don't match requested.Nick Mathewson2022-11-291-1/+0
| | | | | (I think this may be impossible now, since we check in ipc.rs, but IMO it's best to check.)
* ptmgr: Use PluggableTransport::identity in logs.Nick Mathewson2022-11-291-0/+8
| | | | 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-5/+1
|
* Merge remote-tracking branch 'eta/ptreactor-v1' into merge_ptreactorNick Mathewson2022-11-291-16/+24
|\ | | | | | | | | Resolved several conflicts while doing so; mostly with !893 and !895.
| * tor-ptmgr: add PtReactoreta2022-11-291-14/+25
| | | | | | | | | | | | 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.
* | Clarify internal error.Ian Jackson2022-11-291-2/+2
| |
* | ptmgr: Rename ClientTransportFailed, document, and correct its RetryTime.Nick Mathewson2022-11-291-1/+1
| |
* | ptmgr: Replace StdioUnavailable with a PtError.Nick Mathewson2022-11-291-4/+12
|/
* ptmgr: clear up unused_import exceptions.Nick Mathewson2022-11-281-0/+6
|